by searchableguy · 4y ago · 0 comments
It's a drop in replacement for jest. The only change you will need to make in most cases is adding an explicit import for expect, describe, and it. It works without any config with esm and typescript.
It's also 5x faster in development.
It integrates well with vite which is the bundler I use.
Help me understand what you meant by this?
https://github.com/facebook/jest/pull/11529#issuecomment-102...
I'm curious - what do you mean by this? Been using Jest in multiple codebases with typescript and ES Modules and never ran into an issue.
edit: just found this, which seems to confirm my anecdotal xp of esm in jest being weird https://github.com/facebook/jest/pull/11529#issuecomment-102...
https://github.com/grissius/jest-is-a-rude-needy-clown-and-e...
I'm sure that causes the bottleneck for vitest but it's a necessary evil as ecosystem moves toward ES module and no global context across tests.
You can also speed up vitest by changing config to make it behave similar to jest, I think.
The benchmark covers several different scenarios, and memory and time efficiency leans more towards Jest (which is already pretty bad as it is), so I don't think it is fair to declare "A blazing fast". The project looks promising (appreciate ESM and TS support), don't get me wrong, but speed is not its strength.