Skip to content

Commit

Permalink
fix(test): catches module loading errors
Browse files Browse the repository at this point in the history
Fixes #2640
Close #2785
  • Loading branch information
rene-leanix authored and filipesilva committed Oct 28, 2016
1 parent 71423a1 commit f09439c
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 f09439c

Please sign in to comment.