New to Claude Skills? Learn how to install them →

supabase on GitHub

Vitest

OfficialFree

A fast and modern testing framework for Vite apps.

by supabase107.8k stars on supabase/supabase
1 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Vitest does

Vitest is a testing framework designed specifically for projects built with Vite, offering a Jest-compatible API that is ready to use with native ESM, TypeScript, and JSX support. This framework leverages Vite's transformation pipeline, enabling rapid test updates similar to hot module replacement (HMR). With Vitest, developers can expect a seamless integration into their existing Vite applications, allowing them to run tests with minimal configuration.

One of the standout features of Vitest is its smart watch mode, which intelligently reruns only the tests affected by changes in the codebase, optimizing the testing process. Furthermore, it supports multi-threaded workers for parallel test execution, significantly improving performance for large test suites. Built-in coverage reporting through V8 or Istanbul provides insights into test coverage, while snapshot testing, mocking capabilities, and spy utilities enhance the testing experience.

This skill is particularly beneficial for developers working within the Vite ecosystem who want to adopt a modern testing approach without the overhead of additional configuration. It is suitable for both individual developers and teams looking to streamline their testing workflow, ensuring that tests are efficient and easy to manage. The extensive documentation provided in the bundled references allows users to dive deep into specific functionalities, from configuration to advanced type testing and mocking utilities.

In summary, Vitest offers a robust solution for testing Vite applications, combining speed, efficiency, and a familiar API for those transitioning from Jest. Its design caters to modern development practices, making it an essential tool for developers focused on optimizing their testing strategies.

When to use it

Use Vitest when developing applications with Vite and when you require a fast, Jest-compatible testing framework that supports modern JavaScript features.

When not to use it

Vitest may not be suitable for projects not using Vite or for teams that have established testing frameworks that do not require migration.

What you can build with it

Transitioning from Jest to Vitest

If you have an existing Jest test suite, you can easily migrate to Vitest to take advantage of its speed and Vite integration.

Optimizing test execution in Vite apps

Use Vitest to run tests in a Vite application, benefiting from its smart watch mode to only rerun affected tests.

Implementing advanced mocking in tests

Leverage Vitest's built-in mocking utilities to create complex test scenarios without external libraries.

How to install Vitest

View source

1. Install with the skills CLI

npx skills add supabase/supabase/vitest --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by supabase

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

TopicDescriptionReference
ConfigurationVitest and Vite config integration, defineConfig usagecore-config
CLICommand line interface, commands and optionscore-cli
Test APItest/it function, modifiers like skip, only, concurrentcore-test-api
Describe APIdescribe/suite for grouping tests and nested suitescore-describe
Expect APIAssertions with toBe, toEqual, matchers and asymmetric matcherscore-expect
HooksbeforeEach, afterEach, beforeAll, afterAll, aroundEachcore-hooks

Features

TopicDescriptionReference
MockingMock functions, modules, timers, dates with vi utilitiesfeatures-mocking
SnapshotsSnapshot testing with toMatchSnapshot and inline snapshotsfeatures-snapshots
CoverageCode coverage with V8 or Istanbul providersfeatures-coverage
Test ContextTest fixtures, context.expect, test.extend for custom fixturesfeatures-context
ConcurrencyConcurrent tests, parallel execution, shardingfeatures-concurrency
FilteringFilter tests by name, file patterns, tagsfeatures-filtering

Advanced

TopicDescriptionReference
Vi Utilitiesvi helper: mock, spyOn, fake timers, hoisted, waitForadvanced-vi
EnvironmentsTest environments: node, jsdom, happy-dom, customadvanced-environments
Type TestingType-level testing with expectTypeOf and assertTypeadvanced-type-testing
ProjectsMulti-project workspaces, different configs per projectadvanced-projects

Frequently asked questions about Vitest

Similar skills