Vitest Documentation
Vitest testing framework documentation. Use for unit testing, mocking, coverage, snapshots, and Vite-native test configuration.
Quick Reference
| Task | Entry Point |
|---|---|
| Getting started | contents/guide/index.md |
| API reference | contents/api/ |
| Configuration | contents/config/index.md |
| Mocking | contents/guide/mocking.md |
| CLI reference | contents/guide/cli.md |
| Coverage | contents/guide/coverage.md |
| Browser mode | contents/guide/browser/index.md |
| Troubleshooting | contents/guide/common-errors.md |
When to use
Use this skill when the user asks about:
- Writing and running unit or integration tests with Vitest
- Mocking modules, functions, classes, timers, dates, globals, or network requests
- Configuring Vitest (
vitest.config.ts, test options, environments) - Code coverage setup and configuration
- Snapshot testing
- Browser mode and component testing
- TypeScript type-level testing
- Migrating from Jest or other test runners to Vitest
- Vitest CLI flags and programmatic API
How to find information
- First, read
TOC.mdfor complete file listing organized by directory - Identify relevant section based on user's question
- Read specific files for details
TOC.md contains all files organized by directory - always check it first.