Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): Downgrade Karma to 5.1.x
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Keen Yee Liau committed Nov 10, 2020
1 parent a9175be commit 0a32f85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular-devkit/core": "0.0.0",
"@babel/core": "7.12.3",
"@babel/generator": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/preset-env": "7.12.1",
"@babel/runtime": "7.12.1",
"@babel/template": "7.10.4",
Expand Down Expand Up @@ -80,7 +80,7 @@
"peerDependencies": {
"@angular/compiler-cli": "^11.0.0 || ^11.0.0-next",
"@angular/localize": "^11.0.0 || ^11.0.0-next",
"karma": "^5.2.0",
"karma": "~5.1.0",
"ng-packagr": "^11.0.0 || ^11.0.0-next",
"protractor": "^7.0.0",
"tslint": "^6.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
const hasIstanbulReporter = reporters.includes('coverage-istanbul');
if (hasCoveragePlugin && !hasCoverageReporter) {
reporters.push('coverage');
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.`)
}
else if (hasIstanbulPlugin && !hasIstanbulReporter) {
// coverage-istanbul is deprecated in favor of karma-coverage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.2.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
Expand Down

0 comments on commit 0a32f85

Please sign in to comment.