Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Vitest 3.x reference skill covering configuration, test/describe APIs, mocking, coverage, snapshots, and concurrency.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: vitest3description: Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.4metadata:5author: Anthony Fu6version: "2026.1.28"7source: Generated from https://github.com/vitest-dev/vitest, scripts located at https://github.com/antfu/skills8---910Vitest 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.1112**Key Features:**13- Vite-native: Uses Vite's transformation pipeline for fast HMR-like test updates14- Jest-compatible: Drop-in replacement for most Jest test suites15- Smart watch mode: Only reruns affected tests based on module graph16- Native ESM, TypeScript, JSX support without configuration17- Multi-threaded workers for parallel test execution18- Built-in coverage via V8 or Istanbul19- Snapshot testing, mocking, and spy utilities2021> The skill is based on Vitest 3.x, generated at 2026-01-28.2223## Core2425| Topic | Description | Reference |26|-------|-------------|-----------|27| Configuration | Vitest and Vite config integration, defineConfig usage | [core-config](references/core-config.md) |28| CLI | Command line interface, commands and options | [core-cli](references/core-cli.md) |29| Test API | test/it function, modifiers like skip, only, concurrent | [core-test-api](references/core-test-api.md) |30| Describe API | describe/suite for grouping tests and nested suites | [core-describe](references/core-describe.md) |31| Expect API | Assertions with toBe, toEqual, matchers and asymmetric matchers | [core-expect](references/core-expect.md) |32| Hooks | beforeEach, afterEach, beforeAll, afterAll, aroundEach | [core-hooks](references/core-hooks.md) |3334## Features3536| Topic | Description | Reference |37|-------|-------------|-----------|38| Mocking | Mock functions, modules, timers, dates with vi utilities | [features-mocking](references/features-mocking.md) |39| Snapshots | Snapshot testing with toMatchSnapshot and inline snapshots | [features-snapshots](references/features-snapshots.md) |40| Coverage | Code coverage with V8 or Istanbul providers | [features-coverage](references/features-coverage.md) |41| Test Context | Test fixtures, context.expect, test.extend for custom fixtures | [features-context](references/features-context.md) |42| Concurrency | Concurrent tests, parallel execution, sharding | [features-concurrency](references/features-concurrency.md) |43| Filtering | Filter tests by name, file patterns, tags | [features-filtering](references/features-filtering.md) |4445## Advanced4647| Topic | Description | Reference |48|-------|-------------|-----------|49| Vi Utilities | vi helper: mock, spyOn, fake timers, hoisted, waitFor | [advanced-vi](references/advanced-vi.md) |50| Environments | Test environments: node, jsdom, happy-dom, custom | [advanced-environments](references/advanced-environments.md) |51| Type Testing | Type-level testing with expectTypeOf and assertType | [advanced-type-testing](references/advanced-type-testing.md) |52| Projects | Multi-project workspaces, different configs per project | [advanced-projects](references/advanced-projects.md) |53