Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0262738

Browse files
committedApr 27, 2017
auto-add code coverage reporter
1 parent 6cf0bfe commit 0262738

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎packages/@angular/cli/plugins/karma.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
114114
}
115115
});
116116

117+
// When using code-coverage, auto-add coverage-istanbul.
118+
config.reporters = config.reporters || [];
119+
if (testConfig.codeCoverage && config.reporters.indexOf('coverage-istanbul') === -1) {
120+
config.reporters.push('coverage-istanbul');
121+
}
122+
117123
// Our custom context and debug files list the webpack bundles directly instead of using
118124
// the karma files array.
119125
config.customContextFile = `${__dirname}/karma-context.html`;

0 commit comments

Comments
 (0)
Please sign in to comment.