一键导入
vitest
Load when writing or debugging Vitest unit tests, mocks, fixtures, coverage, filtering, or Next.js TypeScript test harness behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Load when writing or debugging Vitest unit tests, mocks, fixtures, coverage, filtering, or Next.js TypeScript test harness behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Load when backend API work touches authentication, authorization, rate limiting, CORS, input validation, public endpoints, or security remediation in Mandate402.
Load when architecture choices, ADRs, trade-off evaluation, technical debt, or pattern selection need explicit decision records for Mandate402.
Load when designing or reviewing backend systems, APIs, auth, databases, security, performance, scalability, CI/CD, monitoring, or production runtime patterns.
Load when reviewing Mandate402 code for secrets, auth, authorization, input validation, payment safety, blockchain integration, or release security risks.
Load when testing Cloudflare Workers, Vitest worker pools, binding mocks, integration tests, coverage, or worker test failures.
Load when planning or building React/Next.js UI with CO-STAR structure, design tokens, dashboards, hero sections, or custom UI prompts.
| name | vitest |
| description | Load when writing or debugging Vitest unit tests, mocks, fixtures, coverage, filtering, or Next.js TypeScript test harness behavior. |
| metadata | {"author":"Anthony Fu","version":"2026.1.28","source":"Generated from https://github.com/vitest-dev/vitest, scripts located at https://github.com/antfu/skills"} |
Vitest is a next-generation testing framework powered by Vite. It provides a Jest-compatible API with native ESM, TypeScript, and JSX support out of the box. Vitest shares the same config, transformers, resolvers, and plugins with your Vite app.
Key Features:
The skill is based on Vitest 3.x, generated at 2026-01-28.
| Topic | Description | Reference |
|---|---|---|
| Configuration | Vitest and Vite config integration, defineConfig usage | core-config |
| CLI | Command line interface, commands and options | core-cli |
| Test API | test/it function, modifiers like skip, only, concurrent | core-test-api |
| Describe API | describe/suite for grouping tests and nested suites | core-describe |
| Expect API | Assertions with toBe, toEqual, matchers and asymmetric matchers | core-expect |
| Hooks | beforeEach, afterEach, beforeAll, afterAll, aroundEach | core-hooks |
| Topic | Description | Reference |
|---|---|---|
| Mocking | Mock functions, modules, timers, dates with vi utilities | features-mocking |
| Snapshots | Snapshot testing with toMatchSnapshot and inline snapshots | features-snapshots |
| Coverage | Code coverage with V8 or Istanbul providers | features-coverage |
| Test Context | Test fixtures, context.expect, test.extend for custom fixtures | features-context |
| Concurrency | Concurrent tests, parallel execution, sharding | features-concurrency |
| Filtering | Filter tests by name, file patterns, tags | features-filtering |
| Topic | Description | Reference |
|---|---|---|
| Vi Utilities | vi helper: mock, spyOn, fake timers, hoisted, waitFor | advanced-vi |
| Environments | Test environments: node, jsdom, happy-dom, custom | advanced-environments |
| Type Testing | Type-level testing with expectTypeOf and assertType | advanced-type-testing |
| Projects | Multi-project workspaces, different configs per project | advanced-projects |