fix(compiler): disable non-components as an entry component (#14335)

PR Close #14335
This commit is contained in:
Bowen Ni
2017-02-06 17:55:58 -08:00
committed by Miško Hevery
parent 56b3b3cbed
commit 44bb337acc
3 changed files with 71 additions and 13 deletions

View File

@ -155,13 +155,11 @@ export function main() {
const logger = new MockConsole();
const errorHandler = new ErrorHandler(false);
errorHandler._console = logger as any;
bootstrap(HelloRootDirectiveIsNotCmp, [
{provide: ErrorHandler, useValue: errorHandler}
]).catch((e) => {
expect(e.message).toBe(
`Could not compile '${stringify(HelloRootDirectiveIsNotCmp)}' because it is not a component.`);
done.done();
});
expect(
() => bootstrap(
HelloRootDirectiveIsNotCmp, [{provide: ErrorHandler, useValue: errorHandler}]))
.toThrowError(`HelloRootDirectiveIsNotCmp cannot be used as an entry component.`);
done.done();
}));
it('should throw if no element is found',