web-testing-vitest
Installation
SKILL.md
Vitest Test Runner Patterns
Quick Guide: Vitest runs tests through the same transform pipeline and config the app is built with, so aliases, plugins and TypeScript work without a second toolchain.
describe/it/expectfor structure,vi.fn()andvi.spyOn()for test doubles,vi.mock()for whole modules, andvi.useFakeTimers()for anything clock-driven. Vitest 4 is current stable (Vite 6+, Node 20+) and changed several mock defaults —vi.restoreAllMocks()no longer resets automocks, andpoolOptionsis gone.
Detailed Resources:
- examples/core.md — test structure and options, spies, module mocking, fake timers, assertions and snapshots
- examples/integration.md — setup files, lifecycle hooks, environments, and mocking at the transport boundary
- examples/anti-patterns.md — what not to write a test for
- reference.md — v3/v4 migration notes, config and mock API lookup