Skip to content

Switch tests from Jest to Vitest - #464

Open
zpao wants to merge 1 commit into
tooling/stable-test-namesfrom
tooling/vitest
Open

zpao wants to merge 1 commit into
tooling/stable-test-namesfrom
tooling/vitest

Conversation

@zpao

@zpao zpao commented Oct 6, 2026

Copy link
Copy Markdown
Owner
  • Replace Jest with Vitest and jsdom.
  • Add Vitest config and setup; update test imports and scripts.
  • Remove unused jest-dom and use the Vitest ESLint plugin for tests.
  • Regenerate snapshots in Vitest format.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@zpao
zpao added this pull request to stack #468 October 6, 2026 05:14
@socket-security

socket-security Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedvitest@​5.0.3981007998100
Updatedjsdom@​26.1.0 ⏵ 30.1.298 +3100100 +195 -2100 +31
Added@​vitest/​eslint-plugin@​1.6.2799100100100100

View full report

@zpao
zpao marked this pull request as ready for review October 6, 2026 05:16
Copilot AI balanced review requested due to automatic review settings October 6, 2026 05:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The obsolete jest.config.js remains and references the removed ts-jest dependency.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Migrates the test suite from Jest to Vitest with jsdom.

Changes:

  • Adds Vitest configuration and cleanup setup.
  • Updates test imports, dependencies, scripts, and ESLint integration.
  • Regenerates snapshots in Vitest format.
File Description
vitest.setup.ts Registers post-test DOM cleanup.
vitest.config.ts Configures Vitest with jsdom.
src/​__test__/​index.test.tsx Replaces Jest imports with Vitest.
src/​__test__/​__snapshots__/​index.test.tsx.snap Converts snapshots to Vitest format.
package.json Replaces Jest tooling and test script.
eslint.config.mjs Replaces the Jest ESLint plugin with Vitest’s plugin.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
"publish-docs": "gh-pages --dist=examples --src='{index.html,iife/demo.js}'",
"serve:examples": "npx serve examples -l 3000",
"test": "jest",
"test": "vitest run",
- Replace Jest with Vitest and jsdom.
- Add Vitest config and setup; update test imports and scripts.
- Remove unused jest-dom and use the Vitest ESLint plugin for tests.
- Regenerate snapshots in Vitest format.

This branch has not been deployed

No deployments
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.

2 participants