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 |
| Writing tests | contents/guide/features.md |
| Test API | contents/api/test.md |
| Expect/assertions | contents/api/expect.md |
| Mocking | contents/guide/mocking.md |
| Coverage | contents/guide/coverage.md |
| Configuration | contents/config/index.md |
| Browser mode | contents/guide/browser/index.md |
When to use
Use this skill when the user asks about:
- •Writing unit tests with Vitest
- •Test assertions and expectations
- •Mocking functions, modules, dates, timers, requests
- •Code coverage configuration
- •Snapshot testing
- •Test filtering and execution
- •Browser mode testing
- •IDE integration and debugging
- •Performance optimization
- •Migration from Jest or other test frameworks
How to find information
- •First, read
TOC.mdfor complete file listing organized by directory - •Identify relevant section based on user's question:
- •API usage: Check
api/directory - •How-to guides: Check
guide/directory - •Configuration: Check
config/directory
- •API usage: Check
- •Read specific files for details
TOC.md contains all files organized by directory - always check it first.