vitest

作者: antfu

由 Vite 驱动的快速单元测试框架,兼容 Jest API。适用于编写测试、模拟、配置覆盖率、处理测试过滤和夹具。

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

相关技能

pinecone-full-text-search
pinecone-io
使用预览API(2026-01.alpha,公开预览版)创建、导入数据并查询Pinecone全文搜索(FTS)索引。当用户或代理要求…时使用。
official
firecrawl-search
firecrawl
Web search with optional content scraping. Returns search results as JSON, optionally with full page content.
official
sred-work-summary
sentry
Go back through the previous year of work and create a Notion doc that groups relevant links into projects that can then be documented as SRED projects.
official
skypilot-multi-cloud-orchestration
firecrawl
跨多云编排机器学习工作负载,自动优化成本。当您需要在多个云上运行训练或批处理作业时使用,利用…
official
elevenlabs-music-generation
agentspace-so
Generate full songs and instrumental tracks with ElevenLabs Music on RunComfy via the `runcomfy` CLI. ElevenLabs Music turns a style description plus structured lyrics into studio-quality 44.1 kHz stereo audio — 5 seconds to 5 minutes — with section-level control (Intro / Verse / Chorus / Bridge), multilingual vocals, and commercial-friendly output. Generate a backing track, a full vocal song, a jingle, a podcast intro, a game loop, or an instrumental bed. Calls `runcomfy run...
creativeaudiomedia
data-validation
anthropic
在分享给利益相关者之前进行质量保证和分析——包括方法论检查、准确性验证和偏见检测。在审查分析是否存在错误时使用……
official
Plugin Structure
anthropic
Standardized directory structure and manifest configuration for Claude Code plugins with automatic component discovery. Follows conventional layout with .claude-plugin/plugin.json manifest, plus root-level commands/ , agents/ , skills/ , and hooks/ directories for auto-discovery Components load automatically: commands and agents as .md files, skills as subdirectories containing SKILL.md , hooks via JSON configuration Use ${CLAUDE_PLUGIN_ROOT} environment variable for all intra-plugin path...
official
chdb-datastore
clickhouse
DataStore is a lazy, ClickHouse-backed pandas replacement . Your existing pandas code works unchanged — but operations compile to optimized SQL and execute only when results are needed (e.g., print() , len() , iteration).
official