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 |
| Test API (test, describe, hooks) | contents/api/test.md |
| Assertions | contents/api/expect.md |
| Mocking / vi utility | contents/api/vi.md |
| Configuration | contents/config/index.md |
| Browser Mode | contents/guide/browser/index.md |
| Coverage | contents/guide/coverage.md |
| Troubleshooting | contents/guide/common-errors.md |
When to use
Use this skill when the user asks about:
- Writing unit tests with Vitest (test, describe, expect, hooks)
- Mocking modules, timers, and functions with
vi - Vitest configuration options, projects, and CLI
- Coverage, snapshots, Browser Mode, and migrating from Jest
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.