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 e64418d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
Expand Down

0 comments on commit e64418d

Please sign in to comment.