vitest

Run and filter Vitest tests with coverage for Vite projects.

5.7k|318|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/antfu/skills --skill vitest-antfu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/antfu/skills/tree/main/skills/vitest
Command: npx skills add https://github.com/antfu/skills --skill vitest-antfu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vitest provides a fast, Jest-compatible unit testing framework built for Vite-powered projects, enabling developers to write and run tests with minimal setup.

Core Features & Use Cases

  • Fast, Vite-native test execution with native ESM and TypeScript support
  • Jest-compatible API for familiar test syntax and ecosystem
  • Smart watch mode, test filtering, and built-in coverage
  • Snapshotting, mocking utilities, and plugin-friendly configuration
  • Ideal for TDD/CI workflows in frontend and library codebases

Quick Start

Install Vitest in your project, add a vitest.config.ts or use vite.config.ts with a test configuration. Write tests using the test() API and run via the Vitest CLI to execute tests and view coverage.

Frequently Asked Questions about vitest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up unit testing for a Vite-based project?

Vitest offers native ESM and TypeScript support for Vite-based projects, executing unit tests directly through Vite's pipeline to minimize configuration and maximize speed.

Can I use a Jest-compatible API for TypeScript unit testing?

Yes, Vitest provides a Jest-compatible API for TypeScript unit testing, allowing developers to use familiar test syntax and ecosystem utilities while benefiting from native ESM support.

What is the best way to run unit tests with smart watch mode and coverage?

Using Vitest is the best way to run unit tests with smart watch mode and coverage, as it provides built-in test filtering, snapshotting, and mocking utilities ideal for TDD and CI workflows.

Do I need a vitest.config.ts file to configure frontend unit tests?

Yes, you need a vitest.config.ts file or a vite.config.ts with a test configuration to configure frontend unit tests, enabling plugin-friendly setup and CLI options for execution.

Does Vitest work with Vite integration for library codebases?

Yes, Vitest works with Vite integration to streamline unit testing for library codebases, allowing you to author, run, filter, and generate coverage for JavaScript and TypeScript tests.