Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the project’s test runner from Jest to Vitest, updating the test setup and dependencies accordingly.
Changes:
- Replace Jest scripts/config with Vitest (
package.json) and add avitest.config.js. - Update test files to import Vitest APIs (
expect,it,vi) instead of relying on Jest globals. - Refresh lockfile to remove Jest-related deps and add Vitest/Vite-related deps.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Switch test scripts to Vitest and replace Jest dev dependency with Vitest. |
vitest.config.js |
Add Vitest configuration (test inclusion + disable watch by default). |
src/__tests__/*.js |
Update tests to use Vitest imports/APIs (e.g., vi.spyOn). |
.eslintrc.js |
Remove Jest-specific ESLint override for test files. |
yarn.lock |
Update dependency graph to reflect Jest removal and Vitest/Vite addition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "build": "rollup ./src/index.js -o index.js --f cjs && babel index.js -o index.js", | ||
| "test": "jest", | ||
| "test:watch": "jest --watch", | ||
| "test": "vitest", | ||
| "test:watch": "vitest --watch", |
There was a problem hiding this comment.
yarn run test now runs vitest, but the repo’s CI config in .travis.yml runs Node 6/8/10/12. Vitest (and its Vite dependency) will not run on those Node versions, so CI will fail unless you also bump the CI Node matrix / declare an engines.node range (or pin Vitest to a version compatible with the supported Node versions).
There was a problem hiding this comment.
I'm assuming a change to GitHub Actions in another PR will get merged, solving this.
There was a problem hiding this comment.
Can you pull in latest and we'll see if it runs?
There was a problem hiding this comment.
Absolutely! Done.
You can see a test run (taking advantage of WIP #202) working on my fork:
https://github.com/wojtekmaj/css-to-react-native/actions/runs/23322301252