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
{{ message }}
Repository navigation
[EPIC] Migrate the unit suite off Karma — 192 specs remaining #403
Karma is deprecated and @angular/build:karma goes with it. The groundwork is done — a Vitest runner, a codemod, and a CI ratchet that stops the Karma set growing — so what remains is moving the specs, batch by batch.
This is the best-stocked source of good first issues in the repo right now. Each sub-issue is a self-contained batch: run one command, run the suite, commit. No design decisions, no domain knowledge, and the result is verifiable by anyone.
How a batch works
# 1. Convert. The codemod does the dialect swap AND the .spec.ts -> .test.ts rename.
node scripts/codemod-jasmine-to-vitest.mjs src/app/features/<area>/**/*.spec.ts
# 2. Run the migrated suite.
npm run test:unit
# 3. Re-record the ratchet baseline.
node scripts/check-test-runner.mjs --write
# 4. The rest of the usual checks.
npm run lint:prune && npm run format && npm test -- --watch=false
npm run check:test-runner prints how many are left.
What the codemod handles, and what it doesn't
It converts dialect — vi.fn() for jasmine.createSpy(), .mockReturnValue() for .and.returnValue(), toBe(true) for toBeTrue(), SpyObj<T>/createSpyObj<T>() from src/app/testing/mocks.ts for the Jasmine equivalents.
It skips whole files that use fakeAsync, tick, flush, done() callbacks, jasmine.clock or the object form of createSpyObj, and tells you which. Those carry zone or callback semantics rather than a spelling, and they are collected in a separate issue that is explicitly not a first issue.
Remaining work by area
Area
Mechanical
Needs a person
features/products
38
1
features/system
32
0
features/accounting
15
0
features/clients
13
0
features/loans
13
0
features/organization
10
0
features/working-capital
10
0
features/spm
5
0
17 smaller areas
23
3
core
1
11
shared
2
3
Total
173
19
Ground rules
One area per PR. A 192-file diff is unreviewable; a 15-file one is not.
The suite must stay arithmetically whole — Karma total + Vitest total should not drop. State both counts in the PR.
Do not "improve" a spec while migrating it. A migration diff that also changes assertions cannot be reviewed as either.
Reopened — this was closed in error when #408 merged. The PR body carried a Closes #403 keyword it should not have had; the groundwork landed, but the migration this epic tracks has barely started.
Actual state: 30 of 222 specs migrated. 192 still on Karma, 0 of 7 sub-issues done.
$ npm run check:test-runner
✓ No new Karma specs. 192 remaining (14% migrated).
30 specs migrated as proof the toolchain works end to end, including Ionic component rendering: Vitest 270 tests, Karma 921, total 1191 — unchanged, so nothing was lost
Current migration tracker. The counts below are from current main.
Why this migration exists
Karma and @angular/build:karma are deprecated upstream. The migration moved the unit suite to Vitest incrementally, preserving test behaviour while the legacy set shrank. The final step was removing the old runner and its temporary migration tooling. See ADR 0004.
Completed
236 Vitest test files
0 Karma spec files
All migration batches landed
#479 removed the deprecated runner, direct dependencies, baseline, codemod and temporary CI paths
Activity
Aman-Mittal commentedon Aug 19, 2026
Reopened — this was closed in error when #408 merged. The PR body carried a
Closes #403keyword it should not have had; the groundwork landed, but the migration this epic tracks has barely started.Actual state: 30 of 222 specs migrated. 192 still on Karma, 0 of 7 sub-issues done.
What #408 actually delivered
The tooling, not the migration:
@angular/build:unit-testwired with the Vitest runner (npm run test:unit), Karma narrowed to**/*.spec.tsscripts/check-test-runner.mjs+karma-baseline.json— the CI ratchet that stops the Karma set growingscripts/codemod-jasmine-to-vitest.mjs— converts 187 of the 215 remaining specssrc/app/testing/mocks.ts,src/testing/vitest-setup.ts,vitest.config.tsWhat remains
All seven sub-issues, unchanged: #404 (system, 32), #405 (accounting, 15), #406 (clients + loans, 26), #407 (organization + working-capital, 20), #409 (products, 39), #410 (the 19
fakeAsync/flushspecs), #411 (17 smaller areas, 28).This epic should close when
check:test-runnerreports 0 remaining and the Karma builder is removed fromangular.json— not before.fix(dialogs): replace the remaining native confirmations in products …
zhangxinyao88 commentedon Aug 26, 2026
Current migration tracker. The counts below are from current
main.Why this migration exists
Karma and
@angular/build:karmaare deprecated upstream. The migration moved the unit suite to Vitest incrementally, preserving test behaviour while the legacy set shrank. The final step was removing the old runner and its temporary migration tooling. See ADR 0004.Completed
#403’s migration work is complete.
Sub-issues
Final state
npm testruns the Vitest suiteCoordination
There are no remaining migration batches to claim. The epic can now be closed.
zhangxinyao88 commentedon Sep 5, 2026
@Aman-Mittal, final verification on current
main:.spec.tsfiles undersrc/.Could you please close #409, #410, and then this epic? Thank you.