tech-vitest
Installation
SKILL.md
Vitest Testing Framework
Fast, Vite-powered testing framework with Jest-compatible API and native ESM. Vitest excels at:
- Watch mode — Instant feedback during development with smart file watching
- Native TypeScript/JSX — Compiled by Vite, no extra setup
- Mocking ecosystem —
vi.mock()for modules, MSW v2 for HTTP requests, fake timers for time-dependent code - Snapshot testing — Auto-managed snapshots with inline snapshot support
- Concurrent tests — Parallel test execution with proper isolation
Core challenge: test isolation. Vitest's hoisting rules for vi.mock() require vi.hoisted() for shared mock state. MSW v2 changes handler APIs. Snapshot updates must be intentional.
Workflow
When setting up tests or adding test cases: