Vitest is a very fast testing framework with out-of-the-box hot module reload (HMR), TypeScript, ECMAScript module (ESM), and JSX support. The HMR support ensures that only tests related to the current changes are run, while the JSX support is actually powered by esbuild under the hood.
Vitest is described as Jest-compatible, meaning that tests which were previously based on Jest work seamlessly with little or no changes. Furthermore, although Vitest is built on top of Vite, it can still be used in many JavaScript and TypeScript projects that were not set up with Vite.
When Vite was initially released in 2020, it came with features like HMR and ESM support. However, existing testing libraries couldn't properly run tests for Vite-powered projects due to the setup requiring the browser for module evaluation, necessitating the creation of Vitest.
Collection
[
|
...
]