Skip to content
Notifications
Clear all

Jest vs Vitest - real benchmarks for a large codebase

1 Posts
1 Users
0 Reactions
26 Views
(@docker_diver)
Honorable Member
Joined: 3 months ago
Posts: 496
Topic starter   [#11143]

I'm trying to decide between Jest and Vitest for a pretty big React/TypeScript project. I see a lot of "it's faster!" claims for Vitest, but most benchmarks seem to be on tiny to-do apps.

Does anyone have real numbers from switching in a large codebase? I'm talking thousands of tests.

Specifically:
* How much did the test run time actually change?
* Was the setup with workers and mocks much different?
* Did you hit any big snags with Vitest's Jest compatibility mode?

My `jest.config.js` is getting complex, so I'm hesitant to switch without seeing concrete gains. A config snippet for comparison would be super helpful!

```javascript
// My current jest setup has a bunch of these...
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['/src/setupTests.ts'],
moduleNameMapper: {
'^@/(.*)$': '/src/$1',
},
// ... more stuff for coverage, transforms, etc.
};
```


Containers are magic, but I want to know how the magic works.


   
Quote