Comments (8)
Official Nextjs example code : https://github.com/vercel/next.js/tree/canary/examples/with-vitest
from next-js-boilerplate.
Why Vitest?
Next.js has a built-in configuration for Jest, which is not the case with Vitest if not wrong?
I can understand we can use Vitest with Vite but Next.js is not build on top of Vite. Love to hear any feedback and suggestion.
What bring Vitest compared to Jest?
from next-js-boilerplate.
https://vitest.dev/guide/comparisons.html#jest
Mainly for performance reasons, faster test suits means faster feedback loop which means improved DX.
There will be official Vite support in Nextjs probably when they reached 1.0
from next-js-boilerplate.
The default configuration provided by Next.js for Jest use @swc/jest behind the scene, should provide a good performance.
Based on some reddit post, Vitest is even slower: https://www.reddit.com/r/reactjs/comments/1066fvv/test_runner_spa_vite_react_vitest_vs_jestswc/?rdt=41518
from next-js-boilerplate.
Here is another post about the performance: https://www.jameslmilner.com/posts/speeding-up-typescript-jest-tests/
from next-js-boilerplate.
The default configuration provided by Next.js for Jest use @swc/jest behind the scene, should provide a good performance.
You may be probably right, sorry I did not considered the SWC,
Most recent bench mark without SWC integration shows it is just marginally faster, probably new Turbo pack will improve the test performance more with Jest or bring a testing capabilities like Bun.
So I'll close this issue!
from next-js-boilerplate.
@kaushalyap Thank you for your suggestion, always open to feedback and suggestion.
I would totally reconsider Vitest in the future, very promising.
from next-js-boilerplate.
Related Issues (20)
- Option for Client Side Redendering(CSR) HOT 1
- Errors with PNPM straight out of the box HOT 7
- Minor typo HOT 1
- Sign-up and Sign-in meta descriptions should be swapped HOT 1
- Add `.devcontainer/devcontainer.json HOT 5
- Image quality HOT 3
- Custom SignOutButton currently not being used HOT 5
- Confusing naming between Schema and Validation. HOT 6
- Should Intl middleware be applied to API routes? HOT 7
- Error: Cannot find module './sw.js.json' HOT 4
- add additional authentication options (not just clerk) HOT 5
- Sentry Auth token HOT 1
- Guide to remove certain dependencies? HOT 2
- How to integrate state management in Zustand with NextJS HOT 1
- Sitemap HOT 9
- Feature request: Turborepo and Documentation HOT 7
- How can we replace tailwindcss with unocss? HOT 1
- Is possible to dockerize application base on this project ?
- Is possible to dockerize application base on this project ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-js-boilerplate.