Skip to content

Commit e64418d

Browse files
author
Keen Yee Liau
committed
fix(@angular-devkit/build-angular): Downgrade Karma to 5.1.x
There's a bug in Karma 5.2.x that causes unit tests to fail when they should not. It was supposed to be fixed in karma-runner/karma#3565 but CI still failed, blocking the release of Karma. In order to mitigate this, we temporarily downgrade Karma back to 5.1.x A side-effect of this is that coverage tests that uses karma-coverage and exceeds the threshold will not fail, because karma-coverage requires Karma 5.2.x. We expect this to be fixed very soon.
1 parent a9175be commit e64418d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/karma.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
9999
const hasIstanbulReporter = reporters.includes('coverage-istanbul');
100100
if (hasCoveragePlugin && !hasCoverageReporter) {
101101
reporters.push('coverage');
102+
logger.warn(`There is a known issue with Karma and karma-coverage. Tests that exceed the coverage threshold will not fail. This will be fixed in Karma 5.2.x soon.`)
102103
}
103104
else if (hasIstanbulPlugin && !hasIstanbulReporter) {
104105
// coverage-istanbul is deprecated in favor of karma-coverage

packages/schematics/angular/workspace/files/package.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"codelyzer": "^6.0.0",
3131
"jasmine-core": "~3.6.0",
3232
"jasmine-spec-reporter": "~5.0.0",
33-
"karma": "~5.2.0",
33+
"karma": "~5.1.1",
3434
"karma-chrome-launcher": "~3.1.0",
3535
"karma-coverage": "~2.0.3",
3636
"karma-jasmine": "~4.0.0",

0 commit comments

Comments
 (0)