vitest
Installation
SKILL.md
Vitest
Vitest is a next-generation testing framework powered by Vite. It uses the same configuration (vite.config.ts), transforms, and plugins as your app, making it incredibly fast and creating a unified dev/test environment.
When to Use
- Modern Vite & ESM Unit Testing: The lightning-fast, native test runner for Vite-powered React, Vue, Svelte, Solid, and Node.js projects.
- Drop-in Jest Replacement: Migrating from Jest to Vitest with identical
describe,it,expect, andviAPIs with zero config overhead. - Instant Watch Mode with HMR: Re-running only affected tests instantaneously when source files change.
- Native TypeScript & JSX Support: Running TypeScript and JSX out of the box without separate transpilation pipelines (ts-jest/babel).
Quick Start
// vite.config.ts
/// <reference types="vitest" />
import { defineConfig } from "vite";