一键导入
vitest
Use when writing unit/integration tests for Vite projects - provides Vitest configuration, test APIs, mocking patterns, and coverage setup
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing unit/integration tests for Vite projects - provides Vitest configuration, test APIs, mocking patterns, and coverage setup
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Suggest conventional commit or pull request titles in the format type(scope): title, written in lowercase English. Use when asked to propose commit messages or PR titles, especially for /create-commit or /create-pr requests.
Generate multiple radically different interface designs for a module using parallel sub-agents. Use when designing an API, exploring interface options, comparing module shapes, or "design it twice".
Conversational refactor planner - interview, scope, plan tiny atomic commits. Use when planning a refactor that needs careful incremental steps.
Conversational PRD writer - interview, scope, write, then create Linear/GitHub issue. Use when planning a new feature or product requirement.
Use when managing Node.js dependencies with pnpm - provides workspace setup, catalogs, CLI commands, overrides, and CI configuration
Use when bundling TypeScript libraries - provides tsdown configuration, dual ESM/CJS output, .d.ts generation, and plugin authoring
| name | vitest |
| description | Use when writing unit/integration tests for Vite projects - provides Vitest configuration, test APIs, mocking patterns, and coverage setup |
| license | MIT |
Vite-native testing framework with Jest-compatible API.
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)
})
})
| 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 |
Consider loading these reference files based on your task:
DO NOT load all files at once. Load only what's relevant to your current task.
vue skill for component patternsts-library skill for library patternsvite skill for shared config