Skip to content

fix(@angular-devkit/build-angular): show missing karma-coverage error when it's not configured #19361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
const hasIstanbulReporter = reporters.includes('coverage-istanbul');
if (hasCoveragePlugin && !hasCoverageReporter) {
reporters.push('coverage');
}
else if (hasIstanbulPlugin && !hasIstanbulReporter) {
} 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