Skip to content

Migrate from Jest to Vitest#6

Merged
Kocal merged 1 commit intomainfrom
migrate-jest-to-vitest
Mar 10, 2026
Merged

Migrate from Jest to Vitest#6
Kocal merged 1 commit intomainfrom
migrate-jest-to-vitest

Conversation

@Kocal
Copy link
Owner

@Kocal Kocal commented Mar 10, 2026

Summary

  • Replace Jest 29 with Vitest 4 for faster and more modern testing
  • Remove cross-env and expect dependencies (no longer needed)
  • Update ESLint configuration to use Vitest globals instead of Jest

Changes

  • Dependencies: Removed jest, cross-env, expect; Added vitest
  • Configuration: Added vitest.config.js with globals enabled
  • Test files: Removed explicit expect imports (using Vitest globals)
  • Utils: Replaced jest.fn() with vi.fn() (using Vitest globals)
  • ESLint: Updated globals from Jest to Vitest
  • Documentation: Updated AGENTS.md with Vitest commands

Benefits

  • Faster test execution (~1.2s vs previous Jest run times)
  • No need for NODE_OPTIONS=--experimental-vm-modules workaround
  • Modern testing framework with better ESM support
  • Smaller dependency footprint (-267 packages)

- Replace Jest 29 with Vitest 4
- Remove cross-env and expect dependencies (no longer needed)
- Add vitest.config.js with globals enabled
- Update test files to use Vitest globals instead of explicit imports
- Update eslint.config.js to use Vitest globals instead of Jest
- Update AGENTS.md documentation
@Kocal Kocal merged commit 543c88d into main Mar 10, 2026
5 checks passed
@Kocal Kocal deleted the migrate-jest-to-vitest branch March 10, 2026 22:05
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.

1 participant