Post

Great post! Vitest does indeed allow users to choose the isolation mode and parallelization method (process, threads) based on their needs. The VM isolation on Vitest has same issues as Jest; node:vm leaks memory and we need to restart forks/threads when a certain limit is reached to prevent OOM.

Choosing between forks or threads is also great, as there are many packages that cause segfaults when run on 'node:worker_threads'. Typically these packages are built using Node-API with C++/Rust/Go. We've listed such packages in github.com/vitest-dev/v.... None of those packages crash with forks.

It's also worth to note that comparing non-isolation mode against Jest isn't really fair, and we've seen even ~10x faster execution times on Vitest without isolation: github.com/vitest-dev/v... Though I think there is a community-driven Jest runner that provides non-isolation mode there too.

Also, as the benchmarked sample is simple (few files to transform, few ESM modules to downgrade etc...), it is beneficial to Jest 😉

0 reposts2 likes