vitest
Vitest is a testing framework powered by Vite that provides a Jest-compatible API with native ESM, TypeScript, and JSX support.
Identity proven by GitHub's verified organisation badge (sanity-io)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- a80a997pinned Oct 9, 2026
- Context cost
- about 950 tokenswhen the skill loads
- GitHub stars
- 20on sanity-io/plugins
- Scripts
- None found
What it does
“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.”
Generated summary from the skill's own text
Vitest is a testing framework powered by Vite that provides a Jest-compatible API with native ESM, TypeScript, and JSX support. It enables fast unit testing with features like smart watch mode, parallel execution, built-in coverage, mocking, snapshots, and multi-project configurations. The skill covers CLI usage, test and assertion APIs, hooks, fixtures, filtering, and advanced testing patterns.
When to use it
- Writing and running unit tests in Vite-based projects
- Replacing Jest with a faster, ESM-native alternative
- Setting up code coverage reporting with V8 or Istanbul
- Testing with mocking, snapshots, or concurrent test execution
When not to
- Projects not using Vite or preferring Jest ecosystem lock-in
- End-to-end or integration testing scenarios requiring browser automation
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add sanity-io/plugins --skill vitestInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install sanity-io/plugins vitest@a80a997e3d11d188f9639ac3efab1d8f93a276efInstalls the commit we checked (a80a997).
Copy by hand
Download the folder at a80a997 and put it in .claude/skills/vitest for Claude Code and in .agents/skills/vitest for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install sanity@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "vitest" by Sanity. Source, pinned to commit a80a997e3d11d188f9639ac3efab1d8f93a276ef: https://github.com/sanity-io/plugins/tree/a80a997e3d11d188f9639ac3efab1d8f93a276ef/.agents/skills/vitest 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/vitest/ for Claude Code and .agents/skills/vitest/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/sanity/vitest
SKILL.md at the pin
--- name: vitest description: 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. 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:** - Vite-native: Uses Vite's transformation pipeline for fast HMR-like test updates - Jest-compatible: Drop-in replacement for most Jest test suites - Smart watch mode: Only reruns affected tests based on module graph - Native ESM, TypeScript, JSX support without configuration - Multi-threaded workers for parallel test execution - Built-in coverage via V8 or Istanbul - Snapshot testing, mocking, and spy utilities > The skill is based on Vitest 3.x, generated at 2026-01-28. ## Core | Topic | Description | Reference | | ------------- | --------------------------------------------------------------- | -------------------------------------------- | | Configuration | Vitest and Vite config integration, defineConfig usage | [core-config](references/core-config.md) | | CLI | Command line interface, commands and options | [core-cli](references/core-cli.md) | | Test API | test/it function, modifiers like skip, only, concurrent | [core-test-api](references/core-test-api.md) | | Describe API | describe/suite for grouping tests and nested suites | [core-describe](references/core-describe.md) | | Expect API | Assertions with toBe, toEqual, matchers and asymmetric matchers | [core-expect](references/core-expect.md) | | Hooks | beforeEach, afterEach, beforeAll, afterAll, aroundEach | [core-hooks](references/core-hooks.md) | ## Features | Topic | Description | Reference | | ------------ | -------------------------------------------------------------- | ---------------------------------------------------------- | | Mocking | Mock functions, modules, timers, dates with vi utilities | [features-mocking](references/features-mocking.md) | | Snapshots | Snapshot testing with toMatchSnapshot and inline snapshots | [features-snapshots](references/features-snapshots.md) | | Coverage | Code coverage with V8 or Istanbul providers | [features-coverage](references/features-coverage.md) | | Test Context | Test fixtures, context.expect, test.extend for custom fixtures | [features-context](references/features-context.md) | | Concurrency | Concurrent tests, parallel execution, sharding | [features-concurrency](references/features-concurrency.md) | | Filtering | Filter tests by name, file patterns, tags | [features-filtering](references/features-filtering.md) | ## Advanced | Topic | Description | Reference | | ------------ | ------------------------------------------------------- | ------------------------------------------------------------ | | Vi Utilities | vi helper: mock, spyOn, fake timers, hoisted, waitFor | [advanced-vi](references/advanced-vi.md) | | Environments | Test environments: node, jsdom, happy-dom, custom | [advanced-environments](references/advanced-environments.md) | | Type Testing | Type-level testing with expectTypeOf and assertType | [advanced-type-testing](references/advanced-type-testing.md) | | Projects | Multi-project workspaces, different configs per project | [advanced-projects](references/advanced-projects.md) |
From sanity-io/plugins at a80a997, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at a80a997Files
- SKILL.md4.2 KB · 3784dac9f0f2
- GENERATION.md136 B · 3cf85efaca1c
- references/
- advanced-environments.md4.3 KB · fc142027abb5
- advanced-projects.md5.0 KB · 33fe123351b4
- advanced-type-testing.md4.6 KB · f61563d6ee7f
- advanced-vi.md4.5 KB · 020c7608ac60
- core-cli.md3.4 KB · 1d03015e185d
- core-config.md3.5 KB · 9ad513208087
- core-describe.md3.4 KB · 7a044789ca68
- core-expect.md4.6 KB · def5ada8c242
- core-hooks.md4.4 KB · d0d2472135d1
- core-test-api.md4.0 KB · 850d3ebf5094
- features-concurrency.md4.2 KB · a8902d13d9d8
- features-context.md4.3 KB · 0788a969450e
- features-coverage.md3.4 KB · 5cbf31dcccb9
- features-filtering.md3.5 KB · fef50ed21305
- features-mocking.md4.7 KB · 6edb22e67412
- features-snapshots.md3.6 KB · 27074b3cb716
18 files, 70 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at a80a997More from Sanity
sanity-live-cache-components
Integrates Sanity Live with Next.js Cache Components in next-sanity v13+ apps, setting up shared cached data fetching through sanityFetch, live content…
Claude Code, Codex, Cursor +4 · about 4K tokens · pinned 6 days ago
content-experimentation-best-practices
This skill provides guidance for designing and running content experiments using A/B and multivariate testing.
Claude Code, Codex, Cursor +4 · about 360 tokens · pinned 6 days ago
content-modeling-best-practices
Guides agents through structured content modeling principles for headless CMSes like Sanity, covering schema design, content reuse strategies, and field…
Claude Code, Codex, Cursor +4 · about 340 tokens · pinned 6 days ago
portable-text-conversion
Converts HTML and Markdown content into Portable Text blocks for Sanity using markdownToPortableText, htmlToBlocks, or manual construction.
Claude Code, Codex, Cursor +4 · about 510 tokens · pinned 6 days ago
portable-text-serialization
This skill enables rendering Portable Text content across multiple frameworks and output formats using the @portabletext library family.
Claude Code, Codex, Cursor +4 · about 940 tokens · pinned 6 days ago
sanity-best-practices
This skill provides best practices for Sanity headless CMS development across schema design, GROQ queries, framework integrations (Next.js, Nuxt, Astro…
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
Related in Testing and QA
emulate
This skill runs local emulated APIs for 14+ third-party services including Vercel, GitHub, Google, Slack, AWS, Stripe, and others.
by VercelOfficial publisher
Claude Code, Codex, Cursor +4 · about 4.7K tokens · pinned 6 days ago
offload-onboard
This skill onboards a repository to use Offload, a parallel test runner that executes tests across Modal cloud sandboxes.
by ImbueOfficial publisher
Claude Code · about 7.1K tokens · pinned 6 days ago
plugin-test-coverage
This skill guides agents through expanding Vitest unit tests and Playwright e2e tests for plugins in a monorepo.
by SanityOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.2K tokens · pinned 6 days ago
test-automator
This skill guides agents in creating and maintaining automated tests across the testing pyramid, from unit tests to integration and end-to-end tests.
by zhaono1Community
Contains scripts
Claude Code, Codex, Cursor +3 · about 1.1K tokens · pinned 6 days ago
typescript-e2e-testing
This skill guides agents through end-to-end and integration testing for TypeScript and NestJS projects using Jest, supertest, and real Docker-based…
by bmad-labsCommunity
Claude Code, Codex, Cursor +4 · about 3.6K tokens · pinned 6 days ago
next-partial-prefetching-optimizer
This skill optimizes Next.js client-side navigation under Partial Prefetching by defining what UI loads before and after a click.
by VercelOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago