You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Karma has been deprecated since April 2023, and the ecosystem has started to act on it.
Jasmine announced the phase-out in jasmine/jasmine#2084: 6.x is the last version compatible with karma-jasmine, and 7.0 removed the APIs that only existed for it. Concretely, jasmine-core 7 ends its Env constructor with Object.freeze(this), while zone.js patches Jasmine by assigning to jasmine.getEnv().describe and friends in place. Every spec then fails to load with TypeError: Cannot assign to read only property 'describe' — see the closed bump build(deps-dev): Bump jasmine-core from 6.3.0 to 7.0.2 in /ui #593.
zone.js is at 0.16.2, which is the newest release on npm, and it has no support for Jasmine 7.
Angular's own builder announces it on every run: The "@angular-devkit/build-angular:karma" builder is deprecated as part of Angular's Webpack support deprecation.
So the UI test dependencies are frozen where they are: jasmine-core stays on 6.x, and .github/dependabot.yml ignores its majors until this issue is done. That is a holding position, not a plan.
What
Move ui/ to Angular's supported unit-test setup (@angular/build:unit-test, Vitest-based) and drop the Karma stack:
angular.json: replace the test target's @angular-devkit/build-angular:karma builder.
Remove karma, karma-chrome-launcher, karma-coverage, karma-jasmine, karma-jasmine-html-reporter, karma.conf.js and src/test.ts.
Carry the coverage floor over. karma.conf.js currently enforces statements 68 / branches 53 / functions 56 / lines 67, and the rule is that work which adds coverage raises it to match — the replacement needs an equivalent gate, or CI loses it silently.
.github/workflows/build_project.yml: check-ui runs npm test -- --watch=false --browsers=ChromeHeadlessCI --code-coverage; the flags change with the runner.
Remove the jasmine-core ignore entry from .github/dependabot.yml.
Acceptance
All 87 existing specs pass unchanged, or every deviation is explained.
Coverage is enforced at no less than today's floor, and check-ui fails when it is undercut.
No karma* package is left in ui/package.json.
jasmine-core can move to its current major again, and the Dependabot ignore is gone.
Why
Karma has been deprecated since April 2023, and the ecosystem has started to act on it.
karma-jasmine, and 7.0 removed the APIs that only existed for it. Concretely,jasmine-core7 ends itsEnvconstructor withObject.freeze(this), whilezone.jspatches Jasmine by assigning tojasmine.getEnv().describeand friends in place. Every spec then fails to load withTypeError: Cannot assign to read only property 'describe'— see the closed bump build(deps-dev): Bump jasmine-core from 6.3.0 to 7.0.2 in /ui #593.zone.jsis at 0.16.2, which is the newest release on npm, and it has no support for Jasmine 7.The "@angular-devkit/build-angular:karma" builder is deprecated as part of Angular's Webpack support deprecation.So the UI test dependencies are frozen where they are:
jasmine-corestays on 6.x, and.github/dependabot.ymlignores its majors until this issue is done. That is a holding position, not a plan.What
Move
ui/to Angular's supported unit-test setup (@angular/build:unit-test, Vitest-based) and drop the Karma stack:angular.json: replace thetesttarget's@angular-devkit/build-angular:karmabuilder.karma,karma-chrome-launcher,karma-coverage,karma-jasmine,karma-jasmine-html-reporter,karma.conf.jsandsrc/test.ts.karma.conf.jscurrently enforces statements 68 / branches 53 / functions 56 / lines 67, and the rule is that work which adds coverage raises it to match — the replacement needs an equivalent gate, or CI loses it silently..github/workflows/build_project.yml:check-uirunsnpm test -- --watch=false --browsers=ChromeHeadlessCI --code-coverage; the flags change with the runner.jasmine-coreignore entry from.github/dependabot.yml.Acceptance
check-uifails when it is undercut.karma*package is left inui/package.json.jasmine-corecan move to its current major again, and the Dependabot ignore is gone.