vitest

Installation
Summary

44 Vitest best practices rules organized by priority, covering async patterns, test setup, mocking, performance, snapshots, and assertions.

  • Async patterns and test isolation are marked CRITICAL; covers awaiting assertions, returning promises, fake timers, and proper cleanup between tests
  • Mocking rules address vi.mock hoisting, spyOn vs mock selection, implementation patterns, and type safety
  • Performance optimization includes pool selection, test isolation toggling, happy-dom preference, sharding for CI, and bail-fast strategies
  • Snapshot testing guidance covers inline vs file snapshots, avoiding large snapshots, stable serialization, and intentional naming
  • Rules organized by impact level with prefixed categories (async-, setup-, mock-, perf-, snap-, env-, assert-, org-) and detailed reference files for each pattern
SKILL.md

Vitest Best Practices

Comprehensive performance optimization and best practices guide for Vitest testing framework. Contains 44 rules across 8 categories, prioritized by impact to guide test writing, refactoring, and code review.

When to Apply

Reference these guidelines when:

  • Writing new Vitest tests
  • Debugging flaky or slow tests
  • Setting up test configuration
  • Reviewing test code in PRs
  • Migrating from Jest to Vitest
  • Optimizing CI/CD test performance

Rule Categories by Priority

Priority Category Impact Prefix
1 Async Patterns CRITICAL async-
Related skills

More from pproenca/dot-skills

Installs
930
GitHub Stars
141
First Seen
Jan 22, 2026