vitest

Installation
SKILL.md

Vitest Best Practices

For test philosophy (behavior vs implementation, TDD workflow, when to mock), see /testing-philosophy.

Critical Rules

  1. Node 22+: Use pool: 'forks' - threads have known issues
  2. CI optimization: Single worker, disable watch, enable isolate: false if safe
  3. Coverage: Always define coverage.include - defaults exclude too much
  4. Mocking: Prefer vi.spyOn over vi.mock - avoids hoisting footguns
  5. RTL cleanup: Requires globals: true in config

Memory Safety (MANDATORY)

Vitest in watch mode holds ~2 GB per process. 12 repos = 24+ GB = machine crash.

Related skills
Installs
19
GitHub Stars
10
First Seen
Feb 5, 2026