jpskill.com
🛠️ 開発・MCP コミュニティ

vitest

Viteを搭載し、Jest互換のAPIを持つ高速な単体テストフレームワークで、テストの記述、モック、カバレッジの設定、テストのフィルタリングやフィクスチャの操作に活用するSkillです。

📜 元の英語説明(参考)

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.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Viteを搭載し、Jest互換のAPIを持つ高速な単体テストフレームワークで、テストの記述、モック、カバレッジの設定、テストのフィルタリングやフィクスチャの操作に活用するSkillです。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o vitest.zip https://jpskill.com/download/5548.zip && unzip -o vitest.zip && rm vitest.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/5548.zip -OutFile "$d\vitest.zip"; Expand-Archive "$d\vitest.zip" -DestinationPath $d -Force; ri "$d\vitest.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して vitest.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → vitest フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
17

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] vitest Vitestは、Viteを搭載した次世代のテスティングフレームワークです。Jest互換のAPIを提供し、ネイティブESM、TypeScript、JSXをすぐにサポートしています。Vitestは、Viteアプリと同じ設定、トランスフォーマー、リゾルバー、プラグインを共有します。

主な機能:

  • Viteネイティブ: Viteの変換パイプラインを使用して、高速なHMRライクなテスト更新を実現します。
  • Jest互換: ほとんどのJestテストスイートのドロップイン代替として使用できます。
  • スマートウォッチモード: モジュールグラフに基づいて、影響を受けるテストのみを再実行します。
  • 設定不要でネイティブESM、TypeScript、JSXをサポートします。
  • 並列テスト実行のためのマルチスレッドワーカーを搭載しています。
  • V8またはIstanbulによる組み込みのカバレッジ機能があります。
  • スナップショットテスト、モック、スパイユーティリティを提供します。

このスキルはVitest 3.xに基づいており、2026-01-28に生成されました。

コア

トピック 説明 参照
設定 VitestとViteの設定統合、defineConfigの使用法 core-config
CLI コマンドラインインターフェース、コマンドとオプション core-cli
テストAPI test/it関数、skip、only、concurrentなどの修飾子 core-test-api
Describe API テストのグループ化とネストされたスイートのためのdescribe/suite core-describe
Expect API toBe、toEqual、マッチャー、非対称マッチャーによるアサーション core-expect
フック beforeEach、afterEach、beforeAll、afterAll、aroundEach core-hooks

機能

トピック 説明 参照
モック viユーティリティによる関数、モジュール、タイマー、日付のモック features-mocking
スナップショット toMatchSnapshotとインラインスナップショットによるスナップショットテスト features-snapshots
カバレッジ V8またはIstanbulプロバイダーによるコードカバレッジ features-coverage
テストコンテキスト テストフィクスチャ、context.expect、カスタムフィクスチャのためのtest.extend features-context
並行性 並行テスト、並列実行、シャーディング features-concurrency
フィルタリング 名前、ファイルパターン、タグによるテストのフィルタリング features-filtering

高度な機能

トピック 説明 参照
Viユーティリティ viヘルパー: mock、spyOn、fake timers、hoisted、waitFor advanced-vi
環境 テスト環境: node、jsdom、happy-dom、カスタム advanced-environments
型テスト expectTypeOfとassertTypeによる型レベルのテスト advanced-type-testing
プロジェクト マルチプロジェクトワークスペース、プロジェクトごとの異なる設定 advanced-projects
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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

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

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。