vitest
作者: antfu
由 Vite 驱动的快速单元测试框架,兼容 Jest API。适用于编写测试、模拟、配置覆盖率、处理测试过滤和夹具。
npx skills add https://github.com/antfu/skills --skill vitestVitest 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
| Topic | Description | Reference |
|---|---|---|
| Configuration | Vitest and Vite config integration, defineConfig usage | core-config |
| CLI | Command line interface, commands and options | core-cli |
| Test API | test/it function, modifiers like skip, only, concurrent | core-test-api |
| Describe API | describe/suite for grouping tests and nested suites | core-describe |
| Expect API | Assertions with toBe, toEqual, matchers and asymmetric matchers | core-expect |
| Hooks | beforeEach, afterEach, beforeAll, afterAll, aroundEach | core-hooks |
Features
| Topic | Description | Reference |
|---|---|---|
| Mocking | Mock functions, modules, timers, dates with vi utilities | features-mocking |
| Snapshots | Snapshot testing with toMatchSnapshot and inline snapshots | features-snapshots |
| Coverage | Code coverage with V8 or Istanbul providers | features-coverage |
| Test Context | Test fixtures, context.expect, test.extend for custom fixtures | features-context |
| Concurrency | Concurrent tests, parallel execution, sharding | features-concurrency |
| Filtering | Filter tests by name, file patterns, tags | features-filtering |
Advanced
| Topic | Description | Reference |
|---|---|---|
| Vi Utilities | vi helper: mock, spyOn, fake timers, hoisted, waitFor | advanced-vi |
| Environments | Test environments: node, jsdom, happy-dom, custom | advanced-environments |
| Type Testing | Type-level testing with expectTypeOf and assertType | advanced-type-testing |
| Projects | Multi-project workspaces, different configs per project | advanced-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