diff --git a/packages/angular-cli/blueprints/ng2/files/__path__/test.ts b/packages/angular-cli/blueprints/ng2/files/__path__/test.ts index 7727c8e6f802..829cc5f934bd 100644 --- a/packages/angular-cli/blueprints/ng2/files/__path__/test.ts +++ b/packages/angular-cli/blueprints/ng2/files/__path__/test.ts @@ -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);