Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

vitest-testing

FreeRuns bundled scriptsNot checked

**AI-friendly comprehensive testing guidance for Vitest with practical patterns and behavior-driven development.**

aiskillstoreby aiskillstore★ 509 GitHub stars

About 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

Most Referenced Patterns


📚 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
Full SKILL.md on GitHub

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
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

README.mdSTATUS.mdSUMMARY.mdTEST-SUITE-EXPLANATION.mdindex.mdpatterns/api-testing.mdpatterns/async-testing.mdpatterns/component-testing.mdpatterns/e2e-testing.mdpatterns/error-testing.mdpatterns/integration-testing.mdpatterns/performance-testing.mdpatterns/test-data.mdpatterns/test-doubles.mdprinciples/aaa-pattern.mdprinciples/bdd-integration.mdprinciples/first-principles.mdprinciples/testing-pyramid.mdquick-reference/cheatsheet.mdquick-reference/decision-tree.mdquick-reference/jest-to-vitest.mdrefactoring/testability-patterns.mdskill-report.jsonstrategies/black-box-testing.mdstrategies/implementation-details.mduser-service.test.tsuser-service.ts

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

Compare vitest-testing with