
17,204 stars · MIT, from the About sidebar on 2026-10-14; the footer credits VoidZero Inc. and Vitest contributors · v5.0.4 (2026-10-12), read from /releases/latest and confirmed independently on registry.npmjs.org/vitest/latest, which also reports 5.0.4 · Track this in Scout
A test runner for JavaScript and TypeScript that reuses a project's existing Vite build settings.
▶Repo detailsthe review · specs · pros & cons · install
What it does
You add it to a project and run it. It reads the build settings the project already has, including the plugins and the rules for finding files, so tests see the code the same way the application does. It watches files and re-runs only the affected tests while you work. Measurements of how much code the tests covered come from two different engines, so you can pick. For code that expects a browser, it can either pretend to be one, with two implementations to choose from, or run the tests in a real browser. It records expected output as snapshots, replaces parts of the program with stand-ins, and accepts the same assertions as the long-established alternative, which is what makes moving to it cheap. It also measures speed, splits a large suite across machines, and handles TypeScript and JSX without extra setup. The newest release is v5.0.4, from 12 October 2026, confirmed on the public package registry, and code landed the same day, from 6,137 commits. What it requires is the thing to check first: Vite 6.4.0 or newer and Node 22.12.0 or newer. A project that does not use Vite has to adopt it before this is an option.
Why it matters
Who it suits. Any JavaScript or TypeScript project already built with Vite, where tests are slow or the test setup has drifted away from the build setup. The shared configuration is the whole point: one set of rules for building and testing means a test cannot pass against code the application would never load. Skip it if the project is built another way, because the requirement is hard, and skip it if the existing test setup is fast and nobody is complaining.
Verdict. The obvious choice for a Vite project and not an option at all for anything else, which makes this a short decision rather than a difficult one. The version requirements are strict and recent — Node 22.12.0 is the floor — so an older project may have to move forward before it can move across. Two features are worth the look even on a project with working tests: running component tests inside a real browser rather than a pretend one, and splitting a large suite across several machines. jestjs/jest at 45,500 stars is the long-standing alternative and the right answer for a project that is not built with Vite, under an MIT licence; the assertions are compatible in both directions, which is why moving between them is a small job. mochajs/mocha at 22,900 stars is the older, smaller runner that leaves the assertions and the stand-ins to you, which suits people who would rather assemble their own tools.
- One set of settings for building and testing, so tests see exactly what the application sees.
- Component tests can run in a real browser, not only in a pretend one.
- Accepts the same assertions as the established alternative, so moving an existing suite is a small job.
- Requires Vite 6.4.0 or newer, so a project built another way cannot use it at all.
- Requires Node 22.12.0 or newer, which is a recent floor for an older project.
- Browser-mode testing adds a browser to the test environment, which is more to install in a build pipeline.
- jestjs/jest
The long-standing JavaScript test framework that works with almost any project, at 45,500 stars, under an MIT licence.
Track this in Scout - mochajs/mocha
An older, smaller test runner that leaves assertions and stand-ins to you, at 22,900 stars, under an MIT licence.
Track this in Scout
npm install -D vitest npx vitest
