Provides comprehensive guidance for Vitest testing framework including fast test execution, Vite integration, component testing, mocking, and configuration. Use when the user asks about Vitest, needs to write fast unit tests, test Vue/React components, or configure Vitest with Vite projects.
View on GitHubpartme-ai/full-stack-skills
development-skills-utils
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/partme-ai/full-stack-skills/blob/main/skills/vitest/SKILL.md -a claude-code --skill vitestInstallation paths:
.claude/skills/vitest/## When to use this skill Use this skill whenever the user wants to: - Set up Vitest in a Vite project - Write unit tests and component tests - Configure Vitest for different environments - Use Vitest API and utilities - Test Vue, React, or Svelte components - Use browser mode for testing - Set up visual regression testing - Mock functions and modules - Use snapshots for testing - Configure test coverage - Use Vitest UI - Optimize test performance - Debug tests - Understand Vitest best practices - Troubleshoot Vitest issues ## How to use this skill This skill is organized to match the Vitest official documentation structure (https://vitest.dev/guide/, https://vitest.dev/api/, https://vitest.dev/config/). When working with Vitest: 1. **Identify the topic** from the user's request: - Getting started/快速开始 → `examples/getting-started.md` - Features/功能特性 → `examples/features.md` - Component testing/组件测试 → `examples/component-testing.md` - Browser mode/浏览器模式 → `examples/browser-mode.md` - API/API 文档 → `api/` - Configuration/配置 → `examples/config/` 2. **Load the appropriate example file** from the `examples/` directory: **Getting Started (快速开始)**: - `examples/getting-started.md` - Installation and first test **Features (功能特性)**: - `examples/features.md` - Key features and capabilities - `examples/ui.md` - Vitest UI - `examples/component-testing.md` - Component testing - `examples/browser-mode.md` - Browser mode testing - `examples/visual-regression-testing.md` - Visual regression testing - `examples/trace-view.md` - Trace view **Testing (测试)**: - `examples/test-api.md` - Test API (test, it, describe, etc.) - `examples/mocking.md` - Mocking functions and modules - `examples/snapshots.md` - Snapshot testing - `examples/coverage.md` - Code coverage **Configuration (配置)**: - `examples/config/basic-config.md` - Basic configuration - `examples/config/environment.md` - Environment configuration - `ex