-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate to Vitest #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to Vitest #280
Conversation
- Replaced `jest`, `ts-jest` and `@types/jest` with `vitest` - Created `vitest.config.ts` - Updated `tsconfig.json` to include vitest globals - Updated all test files to use `vi` instead of `jest` - Updated `package.json` test script
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
There was a problem hiding this 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 successfully migrates the testing framework from Jest to Vitest. The migration includes removing Jest-related dependencies, adding Vitest as a new dev dependency, creating a Vitest configuration file, updating TypeScript configuration to recognize Vitest globals, and refactoring all test files to use vi instead of jest for mocking and spying.
Key Changes:
- Replaced Jest dependencies (@types/jest, jest, ts-jest) with Vitest
- Created vitest.config.ts with equivalent configuration settings
- Updated all test files to use
viinstead ofjestfor mocking - Updated test script to run
vitest runinstead of Jest with experimental VM modules
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Removed Jest dependencies, added Vitest, updated test script |
| vitest.config.ts | New Vitest configuration with globals, node environment, and v8 coverage |
| tsconfig.json | Added Vitest globals type definitions |
| jest.config.ts | Removed Jest configuration file |
| yarn.lock | Updated lockfile with Vitest dependencies and removed Jest-related packages |
| tests/mocks/mockFetch.ts | Changed from jest.fn to vi.fn |
| tests/commands/*.test.ts | Updated all test files to import and use vi instead of jest |
The migration appears to be complete and consistent across all files. No issues were identified with the changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let error: string[]; | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const writeSpy = jest | ||
| const writeSpy = vi |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable writeSpy.
| let error: string[]; | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| const writeSpy = jest | ||
| const writeSpy = vi |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable writeSpy.
Migrated the testing framework from Jest to Vitest. This involves replacing the dependencies, creating a new configuration file for Vitest, updating the TypeScript configuration to recognize Vitest globals, and refactoring the test files to use
viinstead ofjestfor mocking and spying. Thetestscript inpackage.jsonwas also updated to runvitest.PR created automatically by Jules for task 10559607753500242316 started by @bmesuere