What problem does it solve?
It eliminates flaky or misleading Vitest results caused by incorrect async handling, leaking mocks/state across tests, unstable snapshots, and slow CI performance patterns.
Core Features & Use Cases
- Async correctness: Use proper async assertion patterns, return promises correctly, wait on conditions with vi.waitFor, and use fake timers to make time-dependent logic deterministic.
- Test isolation & mocking hygiene: Avoid shared mutable state, clean up in afterEach hooks, restore mocks after each test, reset module cache when needed, and choose vi.spyOn vs vi.mock appropriately to avoid over-mocking.
- Performance & snapshot discipline: Configure pools and environments for speed, optimize CI execution (run mode, bail, sharding), and keep snapshots stable and reviewable to prevent silent regressions.
Quick Start
Use the vitest skill to rewrite your failing or flaky test by applying the relevant rule from the async patterns or test setup categories, then re-run the test suite to confirm it becomes deterministic.