vitest-testing
FreeRuns bundled scriptsNot checked**AI-friendly comprehensive testing guidance for Vitest with practical patterns and behavior-driven development.**
by aiskillstore★ 509 GitHub starsAbout this skill
Vitest Testing Skill - Master Reference
AI-friendly comprehensive testing guidance for Vitest with practical patterns and behavior-driven development.
For humans: Start with README.md for full navigation For AI agents: This file provides quick access to all skill resources
🎯 Quick Access for Agents
Decision Support
- What type of test should I write? → index.md
- How do I structure this test? → principles/aaa-pattern.md
- Is this code testable? → refactoring/testability-patterns.md
Most Referenced Patterns
- F.I.R.S.T Principles - Fast, Isolated, Repeatable, Self-Checking, Timely
- AAA Pattern - Arrange-Act-Assert structure
- Black Box Testing - Test behavior through public APIs
- Test Doubles - Mocks, stubs, spies, fakes
📚 Skill Organization
Core Principles /principles/
Foundation concepts that guide all testing decisions:
| File | Purpose | When to Use |
|---|---|---|
| first-principles.md | F.I.R.S.T quality attributes | Every test |
| aaa-pattern.md | Arrange-Act-Assert structure | Structuring tests |
| bdd-integration.md | Given/When/Then with AAA | Business-focused tests |
Testing Strategies /strategies/
Approaches for different testing scenarios:
| File | Purpose | When to Use |
|---|---|---|
| black-box-testing.md | Testing via public APIs | Default approach (99% of tests) |
| implementation-details.md | When to test internals | Rare exceptions only |
Practical Patterns /patterns/
Ready-to-use patterns for common scenarios:
| File | Purpose | When to Use |
|---|---|---|
| test-doubles.md | Mocks, stubs, spies, fakes | Isolating dependencies |
| async-testing.md | Testing promises, async/await | Async operations |
| error-testing.md | Testing exceptions, edge cases | Error scenarios |
| component-testing.md | React/Vue component patterns | UI components |
| api-testing.md | HTTP clients, REST APIs | API integration |
| performance-testing.md | Benchmarks, load testing | Performance-critical code |
| test-data.md | Factories, builders, fixtures | Test data management |
Refactoring for Testability /refactoring/
Transform untestable code into testable code:
| File | Purpose | When to Use |
|---|---|---|
| testability-patterns.md | Extract pure functions, DI, etc. | Code hard to test |
Quick Reference /quick-reference/
Fast lookups and decision aids:
| File | Purpose | When to Use |
|---|---|---|
| cheatsheet.md | Syntax, matchers, mocking | Quick syntax lookup |
| jest-to-vitest.md | Migration from Jest | Migrating projects |
🤖 Agent Integration Points
For typescript-coder Agent
When writing tests:
// 1. Check decision tree
const testType = checkDecisionTree(codeType)
// Reference: /skills/vitest-testing/index.md
// 2. Apply F.I.R.S.T principles
ensureTestsAreFast() // < 100ms
ensureTestsAreIsolated() // No shared state
// Reference: /skills/vitest-testing/principles/first-principles.md
// 3. Use AAA structure
// Arrange → Act → Assert
// Reference: /skills/vitest-testing/principles/aaa-pattern.md
// 4. Follow black box strategy
testThroughPublicAPI() // Not private methods
// Reference: /skills/vitest-testing/strategies/black-box-testing.md
When refactoring:
// Check if code is testable
if (isHardToTest(code)) {
// Apply testability patterns
applyPattern(testabilityPatterns)
// Reference: /skills/vitest-testing/refactoring/testability-patterns.md
}
For Code Review Agents
Check these aspects:
- Tests follow F.I.R.S.T principles
- Tests use AAA structure
- Tests use black box approach (public APIs only)
- Proper mocking of external dependencies
- Error scenarios covered
- Async operations handled correctly
🎯 Common Workflows
Workflow 1: Writing Tests for New Feature
1. Consult decision tree → /skills/vitest-testing/index.md
2. Determine test type → Unit/Integration/Component
3. Apply F.I.R.S.T principles → /skills/vitest-testing/principles/first-principles.md
4. Structure with AAA → /skills/vitest-testing/principles/aaa-pattern.md
5. Use relevant pattern → /skills/vit
Install vitest-testing in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the vitest-testing skill do?
**AI-friendly comprehensive testing guidance for Vitest with practical patterns and behavior-driven development.**
How do I install the vitest-testing skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the vitest-testing skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic