vitest

Run Jest-compatible unit tests for Vite projects with coverage and snapshots.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/hakushun/ai-dev-starter --skill vitest-hakushun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest
Source: https://github.com/hakushun/ai-dev-starter/tree/main/.cursor/skills/vitest
Command: npx skills add https://github.com/hakushun/ai-dev-starter --skill vitest-hakushun

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vitest provides fast, integrated unit testing for Vite-based projects, offering a Jest-compatible API, native ESM support, and streamlined configuration.

Core Features & Use Cases

  • Fast, Vite-native test execution with instant feedback
  • Jest-compatible API for familiar testing patterns
  • Built-in coverage, snapshots, mocking, and fixtures
  • Use cases: test-driven development, component/unit testing for React, Vite apps, or libraries

Quick Start

Install Vitest in your project and run tests:

  • pnpm add -D vitest
  • npx vitest

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 project using TypeScript?

Unit testing for a Vite project requires installing Vitest via pnpm add -D vitest and running npx vitest. It provides native ESM and TypeScript support, leveraging your existing Vite config for fast execution.

Can I use a Jest-compatible API for testing React components in Vite?

Yes, Vitest offers a Jest-compatible API for testing React components and utilities in modern front-end stacks. It provides familiar testing patterns while utilizing Vite's native ESM and JSX support.

What is the best way to get code coverage and mocks for Vite native ESM?

Vitest provides built-in coverage, mocks, and fixtures for Vite native ESM projects. You get instant feedback and streamlined configuration without additional external mocking libraries.

Does Vitest require a separate configuration file for Vite apps?

No, Vitest integrates directly with your existing Vite config. This Vite-native integration allows for streamlined configuration and fast test execution for your React components and libraries.

How do I run tests with filtering and snapshots in a Vite environment?

Vitest includes built-in snapshot tooling and test filtering for Vite projects. This enables fast test-driven development with instant feedback for your utilities and front-end libraries.