Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add halay08/fullstack-agent-skills --skill "vitest"
Install specific skill from multi-skill repository
# Description
A blazing fast unit testing framework powered by Vite
# SKILL.md
name: vitest
description: A blazing fast unit testing framework powered by Vite
license: MIT
Vitest
Vite-native testing framework with Jest-compatible API.
When to Use
- Writing unit/integration tests for Vite projects
- Testing Vue/React/Svelte components
- Mocking modules, timers, or dates
- Running concurrent/parallel tests
- Type testing with TypeScript
Quick Start
npm i -D vitest
// vitest.config.ts
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
environment: 'node', // or 'jsdom' for DOM tests
},
})
// example.test.ts
import { describe, expect, it, vi } from 'vitest'
describe('math', () => {
it('adds numbers', () => {
expect(1 + 1).toBe(2)
})
})
Reference Files
| Task | File |
|---|---|
| Configuration, CLI, projects | config.md |
| test/describe, hooks, fixtures | test-api.md |
| vi.fn, vi.mock, timers, spies | mocking.md |
| expect, snapshots, coverage, filtering | utilities.md |
| Environments, type testing, browser mode | advanced.md |
Load Based on Task
Setting up tests? β Load config.md
Writing test cases? β Load test-api.md
Mocking dependencies? β Load mocking.md
Assertions/snapshots? β Load utilities.md
DOM/browser/types? β Load advanced.md
Cross-Skill References
- Vue component testing β Use
vueskill for component patterns - Library testing β Use
ts-libraryskill for library patterns - Vite configuration β Use
viteskill for shared config
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.