vitest
Installation
SKILL.md
Vitest is a next-generation testing framework powered by Vite. It provides a Jest-compatible API with native ESM, TypeScript, and JSX support out of the box. Vitest shares the same config, transformers, resolvers, and plugins with your Vite app.
Requirements: Vite >=v6.0.0, Node >=v20.0.0
Key Features:
- Vite-native: Uses Vite's transformation pipeline for fast HMR-like test updates
- Jest-compatible: Drop-in replacement for most Jest test suites
- Smart watch mode: Only reruns affected tests based on module graph
- Native ESM, TypeScript, JSX support without configuration
- Multi-threaded workers via
node:child_process(default) ornode:worker_threads - Built-in coverage via V8 (default) or Istanbul
- Snapshot testing, mocking, and spy utilities via Tinyspy
- Browser mode for real browser component testing
- Benchmarking via Tinybench
- In-source testing
- Type testing via expect-type
- Sharding for CI parallelism
Based on Vitest 4.x (v4.0.17). Key v4 changes:
workspacereplaced withprojects, pool options are top-level, V8 coverage uses AST-based analysis,coverage.allremoved,basicreporter removed.