Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): show missing karma-coverage error…
Browse files Browse the repository at this point in the history
… when it's not configured

This fixes an issue where previously `karma-coverage must be installed in order to run code coverage` error was shown incorrectly.

Closes: #19359
(cherry picked from commit 88a3794)
  • Loading branch information
alan-agius4 authored and clydin committed Nov 12, 2020
1 parent ffd04c7 commit 0068783
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -104,10 +104,10 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
else if (hasIstanbulPlugin && !hasIstanbulReporter) {
// coverage-istanbul is deprecated in favor of karma-coverage
reporters.push('coverage-istanbul');
} else if (!hasCoveragePlugin && !hasIstanbulPlugin) {
throw new Error('karma-coverage must be installed in order to run code coverage.');
}
else {
throw new Error('karma-coverage must be installed in order to run code coverage');
}

if (hasIstanbulPlugin) {
logger.warn(`'karma-coverage-istanbul-reporter' usage has been deprecated since version 11.\n` +
`Please install 'karma-coverage' and update 'karma.conf.js.' ` +
Expand Down

0 comments on commit 0068783

Please sign in to comment.