Migrate jest to vitest - #153
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the project’s unit/integration testing setup from Jest to Vitest to run React/Next.js tests on a Vite-powered runner.
Changes:
- Add Vitest configuration and setup (jsdom env, Testing Library jest-dom matchers, Next.js component mocks).
- Update existing test files/mocks from
jest.*tovi.*and update npm scripts to run Vitest. - Remove Jest configuration and dependencies.
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.setup.tsx | Adds Vitest test setup (jest-dom matchers + mocks for next/image and next/link). |
| vitest.config.ts | Introduces Vitest config (jsdom, setup file, coverage). |
| tsconfig.json | Adds Vitest global types (currently in a way that can break other global types). |
| package.json | Switches scripts to Vitest and replaces Jest-related devDependencies with Vitest/Vite deps. |
| next-env.d.ts | Changes Next-generated route types import path (currently points to a dev-only output path). |
| lib/posts.test.ts | Migrates module mocks from Jest to Vitest (vi.mock, vi.fn). |
| tests/posts-page.test.tsx | Migrates mocks from Jest to Vitest. |
| tests/page.test.tsx | Migrates mocks from Jest to Vitest. |
| jest.setup.tsx | Removed Jest setup file. |
| jest.config.ts | Removed Jest config file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
関連 Issue
概要
詳細
関連資料