vitest
antfu/skills · Agent Skill
Vitest için birimler testleri, taklit, kapsama, fixture ve test filtreleme en iyi uygulamaları.
Kuruluma geç ↓Genel bakış
| Yayıncı | |
|---|---|
| Depo | antfu/skills ↗ |
| Skill klasörü | vitest |
| Yıldız | 6.011 |
| Fork | 338 |
| Dosyalar | 21 |
| Lisans | MIT |
| Son güncelleme | 23 Ekim 2026 |
| Bağlantılar | Skill kaynağı ↗ · Depo ↗ |
Mozgi kontrolü
Skill dosyalarında bulduklarımız. Ayrıntılar abonelikle.
Kurulum
Skill, SKILL.md dosyası içeren bir klasördür. Ajanınızı seçin ve komutları proje kökünde bir terminalde çalıştırın (macOS, Linux veya Windows'ta Git Bash).
Promptu Claude, Codex veya başka bir asistana yapıştırın: skill'i inceleyip sizin için kuracaktır.
Install the “vitest” skill from mozgi.io (https://mozgi.io/skills/antfu-vitest/) for me. 1. Download the archive: https://mozgi.io/skills/antfu-vitest/download If it fails, take the skill folder from the source: https://github.com/antfu/skills/tree/main/skills/vitest 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “vitest” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/vitest/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/antfu/skills.git /tmp/skills mkdir -p .claude/skills cp -r /tmp/skills/skills/vitest .claude/skills/vitest
Claude Code'u yeniden başlatın — skill listede görünür; elle çağırmak için /vitest. Tüm projeler için ~/.claude/skills.
git clone --depth 1 --branch main https://github.com/antfu/skills.git /tmp/skills mkdir -p .agents/skills cp -r /tmp/skills/skills/vitest .agents/skills/vitest
Codex skill'leri geçerli klasörden depo köküne kadar .agents/skills içinde arar; /skills veya $vitest ile çağırın. Tüm projeler için ~/.agents/skills.
git clone --depth 1 --branch main https://github.com/antfu/skills.git /tmp/skills mkdir -p .cursor/skills cp -r /tmp/skills/skills/vitest .cursor/skills/vitest
Cursor skill'i açılışta yükler; Agent sohbetinde “/” ile çağırın. Cursor .claude/skills ve .agents/skills klasörlerini de okur. Tüm projeler için ~/.cursor/skills.
git clone --depth 1 --branch main https://github.com/antfu/skills.git /tmp/skills mkdir -p .gemini/skills cp -r /tmp/skills/skills/vitest .gemini/skills/vitest
Gemini CLI, görev uyduğunda skill'i etkinleştirmeyi önerir — siz onaylarsınız. Tüm projeler için ~/.gemini/skills.
Kurulumdan önce SKILL.md ve eşlik eden dosyaları inceleyin. Önizleme için dosyaya tıklayın.
SKILL.md içeriği
Yazarın orijinal metni · salt okunurVitest 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.1.0-beta.1, generated at 2026-10-23.
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 ↗ |
| Test Tags | Label tests with tags to filter runs and apply shared options | features-test-tags ↗ |
| Reporters | Built-in reporters, default selection, CI/output config | features-reporters ↗ |
| Benchmarking | Write benchmarks with the bench fixture (Tinybench) | features-benchmarking ↗ |
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 ↗ |
Sık sorulan sorular
vitest skill'i ne yapar?
Vitest için birimler testleri, taklit, kapsama, fixture ve test filtreleme en iyi uygulamaları.
vitest nasıl kurulur?
Bu sayfadaki “Kurulum” bölümünü açın ve ajanınızı seçin — Claude Code, Codex, Cursor veya Gemini CLI: skill klasörünü doğru yere kopyalayan hazır komutlar orada. Ya da “Asistanla” sekmesindeki promptu kopyalayın; asistan skill'i inceleyip kuracaktır.
vitest hangi yapay zekâlarla çalışır?
Skill'ler düz Markdown talimatlarıdır (Agent Skills formatı), bu yüzden vitest SKILL.md okuyan her ajanla çalışır: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode ve diğerleri. Model talimatları yalnızca görev skill açıklamasına uyduğunda yükler.
vitest ücretsiz mi?
Skill, antfu tarafından açık olarak yayımlandı (MIT lisansı). Skill'in kendisi ücretsizdir — yalnızca kullandığınız token'lar için yapay zekâ sağlayıcınıza ödeme yaparsınız.
Skill kurmak güvenli mi?
Skill, ajanınızın izleyeceği talimatlardır; kurmadan önce SKILL.md ve eşlik eden dosyaları okuyun. Skill klasöründeki betikler yalnızca ajanınız çalıştırırsa çalışır — ne yaptığını izleyin ve gereksiz izin vermeyin.
Skill, MCP sunucusu veya eklentiden nasıl farklıdır?
MCP sunucusu veya eklenti modele yeni araçlar verir — çalışıp sonuç döndüren kod. Skill ise bilgi ve süreç verir: göreve nasıl yaklaşılacağı, hangi adımların izleneceği ve iyi sonucun neye benzediği. Sunucu veya API anahtarı gerekmez.