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 5.x (beta), generated at 2026-06-22.

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
Test TagsLabel tests with tags to filter runs and apply shared optionsfeatures-test-tags
ReportersBuilt-in reporters, default selection, CI/output configfeatures-reporters
BenchmarkingWrite benchmarks with the bench fixture (Tinybench)features-benchmarking

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

関連スキル

flutter-implement-json-serialization
flutter
Create model classes with `fromJson` and `toJson` methods using `dart:convert`. Use when manually mapping JSON keys to class properties for simple data…
official
n8n:db-migrations
n8n-io
n8nデータベースのマイグレーションを作成します。packages/@n8n/db/src/migrations/ 以下のファイルを作成または変更する際、ユーザーがカラム、テーブル、インデックスなどの追加を依頼した場合に使用します。
official
prepare-pr
nvidia
NeMo RelayのプルリクエストまたはPR本文を、適切なテスト、ドキュメント、コントリビューターの衛生管理、リポジトリのプル…に従って準備、オープン、作成、公開、更新、または編集します。
official
backend
redis
NestJSバックエンド開発パターン(RedisInsight API向け):モジュール構造、サービス、コントローラー、DTO、依存性注入、エラーハンドリング。以下の場合に使用…
official
solana-dev
solana-foundation
ユーザーが「Solana dappを構築する」「Anchorプログラムを書く」「トークンを作成する」「Solanaエラーをデバッグする」「ウォレット接続を設定する」「Solanaプログラムをテストする」「devnetにデプロイする」「Solanaの概念(レント、アカウント、PDA、CPIなど)を説明する」と依頼した場合に使用します。また、公開RPCとcurlを使った迅速なオンチェーン照会(「の残高はいくらか」「トランザクションを調べる」「のトークン残高」「mainnet/devnetでこのアドレスを確認する」)にも使用します。ウォレット接続を含むエンドツーエンドのSolana開発プレイブックです。
development
azure-ai-openai-dotnet
microsoft
Azure OpenAI Service 用のクライアントライブラリで、GPT-4、GPT-4o、embeddings、DALL
official
persona-exec-assistant
Google
経営幹部のスケジュール、受信箱、およびコミュニケーションを管理します。
grill-me
sanity-io
ユーザーの計画や設計について、決定木の各分岐を解決しながら、共通の理解に達するまで執拗にインタビューする。ユーザーが次のことを望む場合に使用する…
official