Skip to content

test: migrate from jest to vitest#210

Merged
JohannesHoppe merged 2 commits into
angular-schule:mainfrom
d-koppenhagen:ng22
Jun 9, 2026
Merged

test: migrate from jest to vitest#210
JohannesHoppe merged 2 commits into
angular-schule:mainfrom
d-koppenhagen:ng22

Conversation

@d-koppenhagen

@d-koppenhagen d-koppenhagen commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Vitest migration

@fmalcher

fmalcher commented Jun 7, 2026

Copy link
Copy Markdown
Member

We did similar things 😬 #211
Can you narrow your PR down to the Vitest migration?

@d-koppenhagen

Copy link
Copy Markdown
Contributor Author

yes! Lets's merge yours first and I will rebase this one.

@d-koppenhagen d-koppenhagen changed the title feat: allow Angular 22 as peerDependency and migrate to Vitest test: migrate from jest to vitest Jun 8, 2026
Comment thread src/commander-fork/test/test.fork-fixes.spec.ts Outdated
- Replace Jest with Vitest as test runner for improved performance
- Update test configuration and snapshots to Vitest format
- Add Angular 22 integration test to CI workflow
- Update documentation to reflect Vitest usage
- Add vitest.config.ts and remove jest.config.js
- Update tsconfig for Vitest compatibility
- Add Angular 22 test fixture for version compatibility testing
- Fix trailing whitespace in README and contributor documentation
- Update supported Angular version range from 18-21 to 18-22
- Change double quotes to single quotes in vitest MockInstance imports
- Align quote style across test.command.allowUnknownOption.spec.ts
- Align quote style across test.fork-fixes.spec.ts
- Align quote style across test.options.version.spec.ts
- Maintain consistency with project's single-quote preference

@JohannesHoppe JohannesHoppe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work!

@JohannesHoppe JohannesHoppe merged commit 312a814 into angular-schule:main Jun 9, 2026
2 checks passed
JohannesHoppe added a commit that referenced this pull request Jun 9, 2026
…e, docs) (#213)

fix: tidy up Vitest migration follow-ups (#210)

Small, non-behavioral cleanups after the Jest→Vitest migration:

- interfaces.ts: revert beforeAdd param `any` → `unknown` (project No-any rule)
- add missing vitest type imports (Mock / MockInstance) to 5 specs that used
  the types without importing them — they aren't provided by vitest/globals,
  so this fixes editor/tsc errors (runtime was unaffected; specs aren't
  typechecked in CI)
- tsconfig.json: types ["vitest/globals", "node"] so specs keep Node ambient
  types (process, Buffer, …)
- prune 2 obsolete jest-format snapshots left behind in ng-add.spec.ts.snap
- builder-integration.spec.ts: drop an unnecessary `as any`
- test.fork-fixes.spec.ts: restore the "implicitly tested by
  test.options.bool.no.spec.ts" note (lost with its empty describe, which
  vitest rejects)
- docs: add "Supporting a new Angular version" to the contributor README TOC

Build clean, all 430 tests green, no obsolete snapshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants