Testing and quality · Tool

Vitest

A fast test runner for JavaScript and TypeScript built on Vite, with a Jest-compatible API, and a common choice for new web projects.

Test runners · Open source · updated

How it works

Vitest reuses a project's Vite configuration, so TypeScript, JSX, ES modules and path aliases work in tests exactly as they do in the app, with no separate Babel setup. Its describe, it, expect and vi.fn() APIs mirror Jest's, which makes moving an existing suite mostly a matter of changing imports. Watch mode reruns only the tests affected by a change, almost instantly.

It covers unit and component tests with jsdom or happy-dom, snapshots, code coverage through V8 or Istanbul, and type tests. Browser Mode runs tests in a real browser through Playwright or WebdriverIO, for components that depend on real browser behaviour. It also works outside Vite projects, such as plain Node.js libraries, and is maintained by the same community as Vite.

Vitest pros and cons

Pros

  • Fast start-up and near-instant watch mode
  • TypeScript and ES modules work with no extra setup
  • Jest-compatible API, so switching is straightforward
  • Browser Mode for tests in a real browser

Cons

  • Younger than Jest, with fewer long-standing guides and plugins
  • Some Jest-specific plugins and mocks need reworking

When to use Vitest

Pick it when

  • Projects built with Vite, including React, Vue, Svelte and Astro apps
  • TypeScript codebases that want tests without transpiler setup
  • New projects choosing a test runner from scratch

Skip it when

  • A large, stable Jest suite where migrating brings little benefit
  • React Native projects, where Jest is the standard

Vitest pricing

Open source

Free (MIT).

Approximate, checked September 2026.What the other tools cost

Vitest vs the alternatives

More in Testing and quality

Test runners

All 10 Testing and quality terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.