vitest

작성자: antfu

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.

npx skills add https://github.com/antfu/skills --skill vitest

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

관련 스킬

logging-best-practices
neondatabase
강력한 디버깅과 분석을 위한 광범위한 이벤트(표준 로그 라인)에 초점을 맞춘 로깅 모범 사례
official
azure-ai-projects-ts
microsoft
Build AI applications using Azure AI Projects SDK for JavaScript (@azure/ai-projects). Use when working with Foundry project clients, agents, connections,…
official
Effective Go
openshift
Apply Go best practices, idioms, and conventions from golang.org/doc/effective_go. Use when writing, reviewing, or refactoring Go code to ensure idiomatic,…
official
winapp-troubleshoot
microsoft
일반적인 Windows 앱 패키징, 서명, ID 및 SDK 오류를 진단하고 수정합니다. MSIX 패키징, 인증서 서명 등에서 오류가 발생할 때 사용하세요.
official
mcp-audit
sentry
Audit MCP servers for protocol compliance, metadata drift, and compatibility regressions. Use when reviewing tool annotations, tool/result schemas, structured…
official
env-vars
vercel
Vercel 환경 변수 전문가 가이드입니다. .env 파일, vercel env 명령어, OIDC 토큰을 사용하거나 환경별 구성을 관리할 때 사용하세요.
official
wix-cli-dashboard-page
wix
관리자 인터페이스, 관리 페이지, CRUD 작업 또는 대시보드 구성 UI를 구축할 때 사용합니다. 트리거에는 대시보드, 관리자 패널, 데이터 등이 포함됩니다.
official
azure-ai-vision-imageanalysis-java
microsoft
Azure AI Vision SDK for Java를 사용하여 이미지 분석 애플리케이션을 구축합니다. 이미지 캡션 생성, OCR 텍스트 추출, 객체 감지, 태깅 등을 구현할 때 사용합니다.
official