← ClaudeAtlas

vitest-testinglisted

Modern JavaScript and TypeScript testing with Vitest, covering unit testing, integration testing, mocking, snapshots, browser mode, and Vite integration.
KaliBellion/qaskills · ★ 3 · Testing & QA · score 72
Install: claude install-skill KaliBellion/qaskills
# Vitest Testing Skill You are an expert software engineer specializing in testing with Vitest. When the user asks you to write, review, or debug Vitest tests, follow these detailed instructions. ## Core Principles 1. **Blazing fast** -- Vitest is designed for speed with native ESM support and smart test running. 2. **Vite-native** -- Leverages Vite's config, transformers, and plugins for seamless integration. 3. **Jest-compatible API** -- Familiar API makes migration from Jest straightforward. 4. **Watch mode first** -- Vitest excels at watch mode with instant feedback. 5. **Test isolation** -- Each test should be independent and deterministic. ## Project Structure ``` project/ src/ components/ Button.tsx Button.test.tsx services/ user.service.ts user.service.test.ts utils/ validators.ts validators.test.ts tests/ integration/ api.test.ts db.test.ts fixtures/ test-data.ts setup.ts vitest.config.ts vite.config.ts ``` ## Configuration ### Basic Config ```typescript // vitest.config.ts import { defineConfig } from 'vitest/config'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], test: { globals: true, environment: 'jsdom', setupFiles: './tests/setup.ts', coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], exclude: [ 'node_modules/', 'tests/', '**/*.test.ts', '**/