22 ms·
If you haven't tried vitest I highly recommend giving it a go. It is compatible with `jest-extended` and most of the jest matcher libraries out there.
by vinnymac 1y ago
If you haven't tried vitest I highly recommend giving it a go. It is compatible with `jest-extended` and most of the jest matcher libraries out there.
- pavel_lishin 1y agoI've heard it recommended; other than speed, what does it have to offer? I'm not too worried about shaving off half-a-second off of my personal projects' 5-second test run :P
- tkcranny 1y agoIt has native TS and JSX support, excellent spy, module, and DOM mocking, benchmarking, works with vite configs, and parallelises tests to be really fast.
- MrJohz 1y agoIt also can transparently run tests directly in a browser rather than mocking the DOM, which is a very cool feature that I haven't used enough yet.
- ezfe 1y agoJest is just not modern, it can't handle modern async/ESM/etc. out of the box. Everything just works in Vitest.
- mitemte 1y agoI don’t think it’s actually faster than Jest in every circumstance. The main selling point, IMO, is that Vitest uses Vite’s configuration and tooling to transform before running tests. This avoids having to do things like mapping module resolution behaviour to match your bundler. Not having to bother with ts-jest or babel-jest is also a plus.
- chamomeal 1y agoAlso it’s got a really nice browser UI. Colocates logs by specific test run. Super nice. I’m sure there’s a package for jest to do that (idk maybe that’s what jest extended is?) but the vitest experience is really nice and complete
- int_19h 1y agoLast time I tried it, IDE integration (e.g. Test Explorer in VSCode) was lacking compared to Jest.