Vitest

From pproenca/dot-skills · View interactive version

Vitest is an AI agent skill from the GitHub repository pproenca/dot-skills. Vitest testing framework patterns for test setup, async testing, mocking with vi.*, snapshots, and test performance (formerly test-vitest). This skill should be used when writing or debugging Vitest tests. This skill does NOT cover TDD methodology (use test-tdd skill), API mocking with MSW (use test

How to use this skill

Skill file

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:

Rule Categories by Priority

| Priority | Category | Impact | Prefix |

|----------|----------|--------|--------|

| 1 | Async Patterns | CRITICAL | async- |

| 2 | Test Setup & Isolation | CRITICAL | setup- |

| 3 | Mocking Patterns | HIGH | mock- |

| 4 | Performance | HIGH | perf- |

| 5 | Snapshot Testing | MEDIUM | snap- |

| 6 | Environment | MEDIUM | env- |

| 7 | Assertions | LOW-MEDIUM | assert- |

| 8 | Test Organization | LOW | org- |

Quick Reference

1. Async Patterns (CRITICAL)

2. Test Setup & Isolation (CRITICAL)

3. Mocking Patterns (HIGH)

4. Performance (HIGH)

5. Snapshot Testing (MEDIUM)

6. Environment (MEDIUM)

7. Assertions (LOW-MEDIUM)

8. Test Organization (LOW)

How to Use

Read individual reference files for detailed explanations and code examples:

Related Skills

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.