Tools · SPBoucher
Menu

Vitest

by VoidZero / Vitest team · Framework

Vite-native unit test framework for JavaScript and TypeScript with a Jest-compatible API, watch mode, coverage and browser mode

MIT licenseOpen sourceFreeLocalCloudSelf-hostable
Visit official site Compare

Link verified Nov 2, 2026

Overview

Vitest is a testing framework for JavaScript and TypeScript developed by the Vite team, now under the VoidZero company, and released under the MIT license. It reuses a project's Vite configuration and transform pipeline, so tests run against the same module resolution, plugins and environment variables as the application, and TypeScript, JSX and ESM work without additional setup.

The API is intentionally close to Jest's (describe, it, expect, mocks, snapshots), which makes migration mostly mechanical. Features include a watch mode that reruns only affected tests, in-source testing, type testing, coverage through V8 or Istanbul, workspaces for monorepos and a browser mode that runs tests in real browsers through Playwright or WebdriverIO. Vitest has become the default test runner for projects built with Vite, Vue, Svelte, SvelteKit and many React setups. Its limitations are that projects not using Vite still need a Vite configuration for the test layer, some Jest ecosystem packages assume Jest internals, and browser mode is newer than the Node-based runner.

Capabilities

  • Jest-compatible API with mocks and snapshots
  • Reuses Vite configuration and plugins
  • Watch mode with affected-test reruns
  • Coverage via V8 or Istanbul
  • Browser mode through Playwright or WebdriverIO
  • Workspaces for monorepos and type testing

Typical workflows

  1. Unit-test a Vite or SvelteKit application without extra transform configuration
  2. Migrate a Jest suite by swapping imports
  3. Run component tests in a real browser

Strengths

  • Shared configuration with the build tool
  • Native ESM and TypeScript support
  • MIT license

Limitations

  • Projects without Vite still need a Vite config
  • Some Jest-specific packages are incompatible
  • Browser mode is less mature than the Node runner

Prerequisites

  • Node.js or Bun; Vite in the project

Who it is for

  • Front-end developers using Vite-based frameworks
  • TypeScript library authors

Alternatives & comparison

Jest is the older, more widely deployed runner with its own transform layer; Vitest replaces that layer with Vite and tends to be simpler in ESM and TypeScript projects. Bun's built-in test runner is also Jest-compatible and fast but tied to the Bun runtime. Playwright covers end-to-end browser testing rather than unit tests, though Vitest's browser mode uses it under the hood.

  • Bun

    All-in-one JavaScript and TypeScript runtime, package manager, bundler and test runner built on JavaScriptCore by Oven

    Open sourceOpen source
  • Jest

    JavaScript testing framework created at Meta with built-in assertions, mocking, snapshot testing and parallel test execution

    Open sourceOpen source
  • Playwright

    Microsoft's browser automation and end-to-end testing framework driving Chromium, Firefox and WebKit from one API in TypeScript, Python, Java and .NET

    Open sourceOpen source
Compare Vitest with its alternatives →

Sources & verification

Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.

Confidence
High
Reviewed
Nov 1, 2026
Links
Verified · Nov 2, 2026

Spotted an error?

Broken link, outdated license, wrong category, or a tool that no longer exists? Tell us; reports are reviewed by the editor.

Puppeteer

Google (Chrome DevTools team) · Data collection & crawling

In-depth entry

Node.js library from the Chrome team for controlling Chrome and Firefox over the DevTools Protocol or WebDriver BiDi, used for scraping, screenshots, PDFs and testing

Apache-2.0Open sourceFreeLocalSelf-hostedNov 2, 2026

ESLint

OpenJS Foundation · Testing & QA

Pluggable static analysis tool for JavaScript and TypeScript that finds problems in code through configurable rules and can fix many automatically

MITOpen sourceFreeLocalNov 2, 2026

Cypress

Cypress.io · Testing & QA

End-to-end and component testing framework that runs tests inside the browser with an interactive runner, paired with the commercial Cypress Cloud

MITOpen sourceFreeLocalNov 2, 2026

Biome

Biome project · Testing & QA

Rust-based formatter and linter for JavaScript, TypeScript, JSX, JSON, CSS and GraphQL that replaces Prettier and ESLint with one binary

MIT OR Apache-2.0Open sourceFreeLocalNov 2, 2026

Semgrep

Semgrep, Inc. · Security tools

Static analysis engine that matches code patterns written in the target language's own syntax, with an LGPL community edition and a commercial AppSec platform

LGPL-2.1-onlyOpen sourceFreemiumLocalNov 2, 2026

Prettier

Prettier project · Testing & QA

Opinionated code formatter for JavaScript, TypeScript, CSS, HTML, Markdown, YAML and more that reprints code from its syntax tree with few options

MITOpen sourceFreeLocalNov 2, 2026