Skip to content

Runner switch and initial spec sweep #4863

Closed

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 [email protected] and @vitest/coverage-v8; remove karma, karma-chrome-launcher, karma-coverage, karma-jasmine, jasmine-core, @types/jasmine, @types/karma-coverage.
  • New configs:
    • vitest.config.ts — globals: 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>, spyOn → vi.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

Activity

  1. changed the title [-]Vitest migration: runner switch + initial spec sweep (step 1 of #4861)[/-] [+]Vitest migration: runner switch + initial spec sweep[/+] on May 3, 2026
  2. changed the title [-]Vitest migration: runner switch + initial spec sweep[/-] [+]Runner switch and initial spec sweep[/+] on May 3, 2026
  3. added theissue type on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions