Dev Resources
Vitest favicon

Vitest

Documentation

VitePress is a Vite-powered static site generator. It provides fast, modern, and lightweight documentation sites with native ESM support and instant hot reload.

Vitest's website screenshot

About Vitest

Vitest is a testing framework built natively on top of Vite, reusing Vite's configuration, resolve, and transform pipelines for both applications and their tests. It can also be used independently of Vite, as it is Jest-compatible and supports backend code.

The framework provides a watch mode that reruns only tests related to changed code, similar to hot module replacement. It includes out-of-the-box support for ESM, TypeScript, and JSX, powered by Oxc, and offers Jest-compatible APIs including expect, snapshot testing, and coverage, which supports migration from Jest.

Vitest is free and open source. It is supported by sponsors including Vercel, Chromatic, and Zammad.

Key features

  • Vite-native test runner that reuses Vite's resolve and transform pipelines
  • Jest-compatible API with expect, snapshot, and coverage support
  • Smart instant watch mode that reruns only related tests, like HMR
  • Out-of-box ESM, TypeScript, and JSX support powered by Oxc
  • Works for backend code even without Vite

Frequently asked questions

Is Vitest free to use?

Yes, Vitest is free and open source.

Do I need to use Vite to use Vitest?

No, Vitest can be used even if you are not using Vite, and it also works for backend code.

Is it easy to migrate from Jest?

Yes, Vitest is Jest-compatible with expect, snapshot, and coverage support, making migration from Jest straightforward.

What languages and syntax does Vitest support out of the box?

Vitest supports ESM, TypeScript, and JSX out of the box, powered by Oxc.

Does Vitest support watch mode?

Yes, it has a smart instant watch mode that only reruns related test changes, similar to HMR.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product

You might also like