Skip to content

Migrate unit test runner from Jest to Vitest#98

Merged
JoyceZhu merged 4 commits into
mainfrom
copilot/migrate-from-jest-to-vitest
Jun 26, 2026
Merged

Migrate unit test runner from Jest to Vitest#98
JoyceZhu merged 4 commits into
mainfrom
copilot/migrate-from-jest-to-vitest

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This PR migrates the repository’s test infrastructure from Jest to Vitest to standardize on a modern ESM-native runner while preserving existing test behavior. The change is limited to test tooling and test entrypoints.

  • Tooling migration

    • Replaced jest with vitest in devDependencies.
    • Updated the test script to run Vitest directly.
  • Configuration cleanup

    • Removed obsolete jest.config.js now that Jest is no longer used.
  • Test compatibility updates

    • Updated the test file to import test globals explicitly from Vitest (test, expect), matching current ESM usage.
{
  "scripts": {
    "test": "vitest run"
  },
  "devDependencies": {
    "vitest": "^4.1.9"
  }
}
import { expect, test } from "vitest";

Copilot AI changed the title Migrate test suite from Jest to Vitest Migrate unit test runner from Jest to Vitest Jun 24, 2026
GitHub Advanced Security started work on behalf of JoyceZhu June 24, 2026 20:37 View session
Copilot AI requested a review from JoyceZhu June 24, 2026 20:37
GitHub Advanced Security finished work on behalf of JoyceZhu June 24, 2026 20:37
@JoyceZhu

Copy link
Copy Markdown
Contributor

@copilot update the whole Babel toolchain to v8.0.0 and above; js-yaml to v5.0.0 and above; markdown-it to 14.2.0 and above.

GitHub Advanced Security started work on behalf of JoyceZhu June 25, 2026 16:00 View session
GitHub Advanced Security finished work on behalf of JoyceZhu June 25, 2026 16:00

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the whole Babel toolchain to v8.0.0 and above; js-yaml to v5.0.0 and above; markdown-it to 14.2.0 and above.

Addressed in a8b0394.

  • Updated @github/markdownlint-github to ^0.8.2, which upgrades its transitive markdown-it to 14.2.0.
  • js-yaml is at ^5.1.0.
  • There are no @babel/* packages in the current lockfile/dependency graph after the Jest removal, so no Babel versions below 8 remain in resolved dependencies.

GitHub Advanced Security started work on behalf of JoyceZhu June 25, 2026 16:01 View session
GitHub Advanced Security finished work on behalf of JoyceZhu June 25, 2026 16:01
@JoyceZhu JoyceZhu marked this pull request as ready for review June 26, 2026 20:22
@JoyceZhu JoyceZhu requested a review from a team as a code owner June 26, 2026 20:22
Copilot AI review requested due to automatic review settings June 26, 2026 20:22

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.

Pull request overview

Migrates the repository’s unit test runner from Jest to Vitest to better support ESM-native testing while keeping the existing test behavior.

Changes:

  • Switched the test npm script from running Jest (with --experimental-vm-modules) to vitest run.
  • Replaced Jest with Vitest in devDependencies and updated the test entrypoint to import Vitest globals explicitly.
  • Removed the obsolete jest.config.js.
Show a summary per file
File Description
src/index.test.js Imports test/expect from Vitest to match the new test runner.
package.json Updates the test script and devDependencies to use Vitest instead of Jest.
jest.config.js Removes the Jest configuration file since Jest is no longer used.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/4 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread package.json
Comment on lines 20 to 22
"dependencies": {
"@github/markdownlint-github": "^0.8.1",
"@github/markdownlint-github": "^0.8.2",
"js-yaml": "^5.1.0",
GitHub Advanced Security started work on behalf of JoyceZhu June 26, 2026 21:46 View session
GitHub Advanced Security finished work on behalf of JoyceZhu June 26, 2026 21:47
@JoyceZhu JoyceZhu merged commit 3f7f833 into main Jun 26, 2026
5 checks passed
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.

4 participants