vitest
作成者: sanity-io
Viteを搭載した高速ユニットテストフレームワークで、Jest互換のAPIを備えています。テストの作成、モック、カバレッジ設定、テストの操作時に使用します。
npx skills add https://github.com/sanity-io/next-sanity --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 |
sanity-ioのその他のスキル
sanity-migration
sanity-io
他のCMSやコンテンツシステムからSanityへの移行を計画、実施、レビューします。AEM、Adobe Experience Manager、Contentful、Strapi、Webflow、WordPress、Payload、Drupal、Markdown/MDX/frontmatterファイル、WXR/XMLエクスポート、CMS API、データベースダンプ、静的HTMLからの移行やSanityへのリプラットフォーム時、または抽出、変換、Portable Text変換、アセット移行、リダイレクト、検証、カットオーバーワークフローの設計時に使用します。
officialdevelopmentdatabase
create-agent-with-sanity-context
sanity-io
Agent Contextを通じてSanityコンテンツへの構造化アクセスを持つAIエージェントを構築します。Sanityを活用したチャットボットのセットアップや、AIアシスタントをSanityに接続する際に使用します…
official
dial-your-context
sanity-io
対話形式で、Sanity Agent Context MCPのInstructionsフィールドの内容を作成するインタラクティブセッションです。エージェントコンテキストの調整や改善についてユーザーが言及した際に、このスキルを使用してください。
official
optimize-agent-prompt
sanity-io
ガイド付き会話を通じてSanity Agent Contextエージェントを調整します。探索データを本番環境対応の指示に変換し、システムプロンプトを作成します…
official
shape-your-agent
sanity-io
Sanity Agent Context MCP を搭載したAIエージェントのシステムプロンプトを作成するためのインタラクティブセッションです。ユーザーがエージェントの性格を定義したい場合にこのスキルを使用します。
official
content-experimentation-best-practices
sanity-io
コンテンツ実験の設計、実行、分析に関する構造化されたガイダンスで、コンバージョンとエンゲージメントを向上させます。仮説フレームワーク、指標の選択、サンプルサイズの計算、A/Bテストや多変量実験における統計的有意性検定を網羅。p値、信頼区間、検出力分析、結果解釈のためのベイズ手法に関する詳細なリソースを提供。フィールドレベルでバリアントを管理し、外部と接続するためのCMS統合パターンを含みます。
official
content-modeling-best-practices
sanity-io
構造化コンテンツモデリングのガイダンス:スキーマ設計、再利用性、マルチチャネル配信に対応。コンテンツをページではなくデータとして扱う、単一情報源の維持、将来のチャネルに対応した設計、編集者ワークフローの最適化といった基本原則を網羅。参照と埋め込みオブジェクトの判断基準、関心の分離、コンテンツ再利用パターンを提供。フラット、階層的、ファセット型アプローチのタクソノミーと分類ガイダンスを提示。対象範囲:...
official
portable-text-conversion
sanity-io
HTMLおよびMarkdownコンテンツをSanity用のPortable Textブロックに変換します。レガシーCMSからのコンテンツ移行時や、HTMLやMarkdownをSanityにインポートする際に使用します。
official