What problem does it solve?
Vitest helps you write and run reliable unit tests for modern TypeScript (and JavaScript) codebases without slow, heavy tooling or brittle setup.
Core Features & Use Cases
- Vite-native speed: HMR-based test execution that keeps feedback loops tight for day-to-day development.
- TypeScript-first testing: Built-in support for authoring type-safe tests, including compile-time type assertions.
- Mocking & isolation: Module mocking and spies using Vitest's vi API, plus timer mocking for deterministic async behavior.
- Component testing integrations: React Testing Library and Vue Test Utils patterns for UI-level confidence.
- Coverage and snapshots: v8/c8 coverage configuration and snapshot testing (including inline snapshots).
- Jest migration path: Jest-compatible API surface and a practical checklist for switching test suites.
Quick Start
Install Vitest, create a vitest.config.ts for your chosen environment (node or jsdom/happy-dom), add a file like src/something.test.ts, and run it with npx vitest.