changing order of event and coverage reporters

Fixing an issue when event reporter is executed before coverage reporter, which was causing the test command to pass even though unit testing coverage thresholds were not met.
This commit is contained in:
banjankri 2018-07-13 12:24:25 +02:00 committed by Hans
parent 839c1f8a8d
commit 09d019e733

View File

@ -67,6 +67,13 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
failureCb = config.buildWebpack.failureCb;
config.reporters.unshift('@angular-devkit/build-angular--event-reporter');
// When using code-coverage, auto-add coverage-istanbul.
config.reporters = config.reporters || [];
if (options.codeCoverage && config.reporters.indexOf('coverage-istanbul') === -1) {
config.reporters.unshift('coverage-istanbul');
}
// Add a reporter that fixes sourcemap urls.
if (options.sourceMap) {
config.reporters.unshift('@angular-devkit/build-angular--sourcemap-reporter');
@ -107,12 +114,6 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
config.webpack = Object.assign(webpackConfig, config.webpack);
config.webpackMiddleware = Object.assign(webpackMiddlewareConfig, config.webpackMiddleware);
// When using code-coverage, auto-add coverage-istanbul.
config.reporters = config.reporters || [];
if (options.codeCoverage && config.reporters.indexOf('coverage-istanbul') === -1) {
config.reporters.push('coverage-istanbul');
}
// Our custom context and debug files list the webpack bundles directly instead of using
// the karma files array.
config.customContextFile = `${__dirname}/karma-context.html`;