fix(exception_handler): log errors that are thrown by the compiler

This commit is contained in:
vsavkin
2015-08-05 10:37:11 -07:00
parent b4a062983b
commit 07b9be798c
4 changed files with 25 additions and 20 deletions

View File

@ -92,11 +92,16 @@ export function main() {
it('should throw if bootstrapped Directive is not a Component',
inject([AsyncTestCompleter], (async) => {
var refPromise = bootstrap(HelloRootDirectiveIsNotCmp, [testBindings]);
var logger = new _ArrayLogger();
var exceptionHandler = new ExceptionHandler(logger, false);
var refPromise =
bootstrap(HelloRootDirectiveIsNotCmp,
[testBindings, bind(ExceptionHandler).toValue(exceptionHandler)]);
PromiseWrapper.then(refPromise, null, (exception) => {
expect(exception).toContainError(
`Could not load '${stringify(HelloRootDirectiveIsNotCmp)}' because it is not a component.`);
expect(logger.res.join("")).toContain("Could not load");
async.done();
return null;
});