Skip to content

Migrate from Jest to Vitest#3173

Merged
tom2drum merged 8 commits intomainfrom
tom2drum/vitest
Dec 10, 2025
Merged

Migrate from Jest to Vitest#3173
tom2drum merged 8 commits intomainfrom
tom2drum/vitest

Conversation

@tom2drum
Copy link
Copy Markdown
Collaborator

Description and Related Issue(s)

This PR migrates the test framework from Jest to Vitest, aligning with the project's testing strategy documented in CONTRIBUTING.md. The migration includes updating dependencies, test configuration, and all test files to use Vitest's API.

Proposed Changes

  • Test framework migration: Replaced Jest with Vitest as the unit testing framework

    • Removed Jest dependencies (jest, jest-environment-jsdom, jest-fetch-mock, ts-jest, @types/jest, eslint-plugin-jest)
    • Added Vitest dependencies (vitest, vitest-fetch-mock, eslint-plugin-vitest, jsdom)
    • Updated test scripts: replaced test:jest and test:jest:watch with test:vitest
    • Migrated all test files from Jest to Vitest syntax and configuration
    • Updated ESLint configuration to use Vitest plugin instead of Jest plugin
  • Dependency updates:

    • Updated Playwright from 1.49.0 to 1.57.0 (including @playwright/test and @playwright/experimental-ct-react)
    • Updated Node.js engine requirement from 22.11.0 to >=22.14.0
    • Updated npm engine requirement from 10.9.0 to >=10.9.0
    • Updated esbuild from 0.21.5 to 0.25.12
    • Updated @chakra-ui/cli from 3.15.0 to 3.30.0
    • Updated vite-tsconfig-paths from 4.3.2 to 5.1.4
  • Configuration updates:

    • Removed jest.config.ts and Jest-related configuration files
    • Updated playwright-ct.config.ts for compatibility with new Playwright version
    • Updated Docker commands to use Playwright v1.57.0-noble image
    • Regenerated all Playwright component test screenshots due to Playwright version update
  • Documentation: No changes to environment variables

Breaking or Incompatible Changes

  • Test command change: The test command has changed from yarn test:jest to yarn test:vitest. Developers need to update their local scripts and CI/CD pipelines accordingly.
  • Node.js version requirement: Minimum Node.js version is now 22.14.0 (previously 22.11.0). Developers need to upgrade Node.js if running an older version.

Additional Information

This migration maintains the same test coverage and functionality while modernizing the testing infrastructure. All existing tests have been successfully migrated to Vitest, and the test suite runs with the new framework.

Checklist for PR author

  • I have tested these changes locally.
  • I added tests to cover any new functionality, following this guide
  • Whenever I fix a bug, I include a regression test to ensure that the bug does not reappear silently.
  • If I have added, changed, renamed, or removed an environment variable
    • I updated the list of environment variables in the documentation
    • I made the necessary changes to the validator script according to the guide
    • I added "ENVs" label to this pull request

@tom2drum tom2drum added the dependencies Pull requests that update a dependency file label Dec 10, 2025
@tom2drum tom2drum merged commit 1fd77f1 into main Dec 10, 2025
11 checks passed
@tom2drum tom2drum deleted the tom2drum/vitest branch December 10, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant