Skip to content

Migrate tests to Vitest#109

Merged
j178 merged 1 commit intomainfrom
vitest-cleanup
Mar 17, 2026
Merged

Migrate tests to Vitest#109
j178 merged 1 commit intomainfrom
vitest-cleanup

Conversation

@j178
Copy link
Copy Markdown
Owner

@j178 j178 commented Mar 17, 2026

Summary

  • replace Jest with Vitest 4.1.0 for the TypeScript test suite
  • simplify and restructure the tests with clearer describe blocks and shared mock state
  • remove the old Jest config and use a minimal Vitest config

Verification

  • npm run build
  • npm run test

Copilot AI review requested due to automatic review settings March 17, 2026 12:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the repository’s TypeScript unit tests from Jest/ts-jest to Vitest, updating test files and configuration to run under the new test runner.

Changes:

  • Added a vitest.config.mjs and switched npm test to vitest run.
  • Updated unit tests to use Vitest APIs (describe/it/vi) and Vitest mocking patterns.
  • Removed Jest configuration and Jest-related devDependencies.

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vitest.config.mjs Adds Vitest runner configuration (node environment, include pattern, clearMocks).
package.json Replaces Jest-based test script and devDependencies with Vitest.
jest.config.mjs Removes Jest/ts-jest configuration.
test/prek.test.ts Ports Jest mocks to Vitest mocks using vi.hoisted and vi.mock.
test/manifest.test.ts Ports module-mocking and tests to Vitest, with module resets between cases.
test/install.test.ts Ports test structure from test() to describe/it under Vitest.
test/cache.test.ts Ports action toolkit mocking to Vitest; introduces a hoisting-sensitive mock context.

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

Comment thread test/cache.test.ts Outdated
Comment thread package.json
@j178 j178 added the internal label Mar 17, 2026
@j178 j178 merged commit 69c8a2b into main Mar 17, 2026
9 checks passed
@j178 j178 deleted the vitest-cleanup branch March 17, 2026 12:22
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44e069a26f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants