Vitest is a test runner designed around the Vite build tool. Because it reuses the same configuration, plugins and module transforms as the application under test, tests run against code that behaves like production code, and the same setup works for TypeScript, JSX, Vue, React and plain JavaScript packages without a separate bundling pipeline.
The site documents getting started, the test and expect APIs, describe and it blocks, mocking of modules, timers and functions, snapshots, coverage providers, filtering and watch mode, workspace and projects configuration, browser mode, and the command line interface, along with a comparison guide for teams migrating from Jest.
It suits frontend teams already using Vite, library authors who need fast feedback on many small modules, maintainers migrating an existing Jest suite, and continuous integration pipelines that benefit from parallel execution, caching and a very short cold start on each run.
Compared with Jest it usually needs far less transform configuration in Vite projects and starts noticeably faster, though some ecosystem plugins and older mocking patterns may require adjustment; compared with a bare Node test runner it adds a richer assertion library, watch mode and integrated coverage reporting.
Reuse the Vite config instead of duplicating transform rules, prefer explicit cleanup between tests to avoid shared state, enable coverage only where it is needed for speed, and check the migration guide before assuming every Jest matcher and mock behaves identically.
407106872@qq.com
Copyright © 2026 Torv.cn All Rights Reserved.