Skip to content

Commit a4d52be

Browse files
committed
Catches & logs errors in module loading in ng2's test.ts
Fixes #2640
1 parent e844706 commit a4d52be

File tree

1 file changed

+10
-1
lines changed
  • packages/angular-cli/blueprints/ng2/files/__path__

1 file changed

+10
-1
lines changed

packages/angular-cli/blueprints/ng2/files/__path__/test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ Promise.all([
2929
// Then we find all the tests.
3030
.then(() => require.context('./', true, /\.spec\.ts/))
3131
// And load the modules.
32-
.then(context => context.keys().map(context))
32+
.then(context => {
33+
try {
34+
return context.keys().map(context);
35+
} catch (e) {
36+
if (console) {
37+
console.error(e.message, e.stack);
38+
}
39+
throw e;
40+
}
41+
})
3342
// Finally, start Karma to run the tests.
3443
.then(__karma__.start, __karma__.error);

0 commit comments

Comments
 (0)