Skip to content

Runner switch and initial spec sweep #4863

@Yicong-Huang

Description

@Yicong-Huang

Task Summary

Land the Karma → Vitest runner switch and the bulk Jasmine → Vitest spec sweep Captured by PR #4862.

Scope (in this step)

  • Replace the test Architect builder: @angular-builders/custom-webpack:karma@angular/build:unit-test with runner: vitest.
  • Add vitest@4.0.8 and @vitest/coverage-v8; remove karma, karma-chrome-launcher, karma-coverage, karma-jasmine, jasmine-core, @types/jasmine, @types/karma-coverage.
  • New configs:
    • vitest.config.tsglobals: true so existing Jasmine-style specs use bare describe/it/expect
    • src/vitest-globals.d.ts — triple-slash reference for vitest/globals types (workaround for parent tsconfig's pinned typeRoots)
    • src/jsdom-svg-polyfill.ts — stub SVGSVGElement#createSVGMatrix etc. so jointjs can instantiate under jsdom
    • src/main.test.ts — minimal entry that keeps the test bundle from pulling AppModule → every component
    • src/tsconfig.test.json — relaxes strict template type-checking for the test build only
  • Mechanical Jasmine → Vitest sweep over 73 spec files (~400 substitutions): matchers, .and.* chain, jasmine.createSpy(Obj), jasmine.SpyObj<T>Mocked<T>, spyOnvi.spyOn, etc.
  • CI: switch frontend test invocation --code-coverage--coverage --coverage-reporters=lcovonly. Codecov upload glob unchanged.
  • Stub two empty specs (workflow-executions.service.spec.ts, joint-ui.service.spec.ts) with it.todo placeholders so vitest discovery doesn't fail.

Result

Test Files  14 passed | 2 skipped (16)
     Tests  109 passed | 2 todo  (111)

Out of scope (other steps)

The other ~57 specs need follow-ups tracked in their own sub-issues:

  • 43 component specs: NgModule → standalone migration
  • 13 service specs reaching the auth.service → modal chain
  • drag-drop.service.spec.ts: needs Vitest browser mode
  • any type tightening across spec files

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions