Skip to content

Commit

Permalink
Catches & logs errors in module loading in ng2's test.ts
Browse files Browse the repository at this point in the history
Fixes #2640
  • Loading branch information
rene-leanix committed Oct 20, 2016
1 parent 35da1f8 commit 1bb49f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/angular-cli/blueprints/ng2/files/__path__/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ Promise.all([
// Then we find all the tests.
.then(() => require.context('./', true, /\.spec\.ts/))
// And load the modules.
.then(context => context.keys().map(context))
.then(context => {
try {
return context.keys().map(context);
} catch (e) {
if (console) {
console.error(e.message, e.stack);
}
throw e;
}
})
// Finally, start Karma to run the tests.
.then(__karma__.start, __karma__.error);

0 comments on commit 1bb49f5

Please sign in to comment.