unit-testing-vitest

Installation
SKILL.md

Unit Testing (Vitest)

Guidelines for writing reliable, fast, and maintainable unit tests with Vitest in JS/TS projects. Contains 13 rules across 6 categories, prioritized by impact.

When to Apply

Reference these guidelines when:

  • Writing new unit tests for functions, classes, or components
  • Adding or reviewing vi.fn() / vi.mock() / vi.spyOn() usage
  • Configuring Vitest coverage thresholds or CI gates
  • Debugging a test that's flaky, hangs, or silently passes
  • Refactoring code and needing tests that won't break on implementation changes

Rule Categories by Priority

Installs
3
First Seen
Nov 17, 2026