一键导入
vitest
Vitest unit testing — Vite-powered, Jest-compatible. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Vitest unit testing — Vite-powered, Jest-compatible. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End a session — extract learnings, write handoff, store patterns, detect doc drift. Use when ending a work session or when the user says done/bye/closing.
Build anything — features, bug fixes, refactors, spikes, migrations. Auto-detects strategy, integrates with backlog, enforces TDD. The unified dev command.
Align a project to brana practices — assess gaps, plan, implement, verify. Auto-detects type. Use when setting up a new project or realigning an existing one.
Scan and diagnose a project, or scaffold a new client from scratch. Works for code and venture clients. Auto-detects project type.
Manage the backlog — plan, track, navigate phases and streams. Use when planning phases, viewing roadmaps, or restructuring work.
Structured bug fix — reproduce (failing test), diagnose, fix (minimal change), verify, commit. Enforces test-first. Use when a bug needs a methodical fix.
| name | vitest |
| description | Vitest unit testing — Vite-powered, Jest-compatible. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures. |
| group | brana |
| keywords | ["vitest","testing","vite","jest","mocking","coverage","typescript","esm","fixtures","snapshots"] |
| allowed-tools | ["Read","Write","Edit","Bash","Glob","Grep","Agent"] |
| status | experimental |
| source | https://github.com/supabase/supabase @vitest |
| acquired | 2026-04-30 |
| quarantine | false |
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 (upstream references/core-config.md, not installed locally) |
| CLI | Command line interface, commands and options | core-cli (upstream references/core-cli.md, not installed locally) |
| Test API | test/it function, modifiers like skip, only, concurrent | core-test-api (upstream references/core-test-api.md, not installed locally) |
| Describe API | describe/suite for grouping tests and nested suites | core-describe (upstream references/core-describe.md, not installed locally) |
| Expect API | Assertions with toBe, toEqual, matchers and asymmetric matchers | core-expect (upstream references/core-expect.md, not installed locally) |
| Hooks | beforeEach, afterEach, beforeAll, afterAll, aroundEach | core-hooks (upstream references/core-hooks.md, not installed locally) |
| Topic | Description | Reference |
|---|---|---|
| Mocking | Mock functions, modules, timers, dates with vi utilities | features-mocking (upstream references/features-mocking.md, not installed locally) |
| Snapshots | Snapshot testing with toMatchSnapshot and inline snapshots | features-snapshots (upstream references/features-snapshots.md, not installed locally) |
| Coverage | Code coverage with V8 or Istanbul providers | features-coverage (upstream references/features-coverage.md, not installed locally) |
| Test Context | Test fixtures, context.expect, test.extend for custom fixtures | features-context (upstream references/features-context.md, not installed locally) |
| Concurrency | Concurrent tests, parallel execution, sharding | features-concurrency (upstream references/features-concurrency.md, not installed locally) |
| Filtering | Filter tests by name, file patterns, tags | features-filtering (upstream references/features-filtering.md, not installed locally) |
| Topic | Description | Reference |
|---|---|---|
| Vi Utilities | vi helper: mock, spyOn, fake timers, hoisted, waitFor | advanced-vi (upstream references/advanced-vi.md, not installed locally) |
| Environments | Test environments: node, jsdom, happy-dom, custom | advanced-environments (upstream references/advanced-environments.md, not installed locally) |
| Type Testing | Type-level testing with expectTypeOf and assertType | advanced-type-testing (upstream references/advanced-type-testing.md, not installed locally) |
| Projects | Multi-project workspaces, different configs per project | advanced-projects (upstream references/advanced-projects.md, not installed locally) |
services/frontend-v2/, not repo root — @/ alias resolves relative to vitest.config.ts directory (see feedback_vitest_cwd_alias.md)@/lib/supabase/client before any import that transitively reaches it (see feedback_supabase_mock_at_import.md)