vitest

antfu/skills · Agent Skill

Migliori pratiche di testing Vitest per unit test, mock, copertura, fixture e filtraggio dei test.

Vai all'installazione ↓

Panoramica

AutoreantfuCommunity
Repositoryantfu/skills ↗
Cartella dello skillvitest
Stelle6011
Fork338
File inclusi21
LicenzaMIT
Aggiornato23 ottobre 2026
LinkSorgente dello skill ↗ · Repository ↗

Verifica Mozgi

Cosa abbiamo trovato nei file dello skill. I dettagli con l’abbonamento.

Sicurezza
rischio basso · nessun rischio evidente — il report completo mostra i dettagli
Compatibilità
solo istruzioni — funziona con la maggior parte degli agenti
Skill simili
62 skill simili trovati
Inoltre con l’abbonamento

Installazione

Uno skill è una cartella con un file SKILL.md. Scegli il tuo agente ed esegui i comandi in un terminale (macOS, Linux o Git Bash su Windows) dalla radice del progetto.

Incolla il prompt in Claude, Codex o un altro assistente: controllerà lo skill e lo installerà.

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.

File dello skill

21 file Scarica ZIP

Leggi SKILL.md e i file correlati prima di installare. Clicca un file per l'anteprima.

Contenuto di SKILL.md

Testo originale dell'autore · sola lettura

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.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 ↗ |

Domande frequenti

Che cosa fa lo skill vitest?

Migliori pratiche di testing Vitest per unit test, mock, copertura, fixture e filtraggio dei test.

Come si installa vitest?

Apri il blocco “Installazione” in questa pagina e scegli il tuo agente — Claude Code, Codex, Cursor o Gemini CLI — per i comandi pronti che copiano la cartella dello skill nel posto giusto. Oppure copia il prompt dalla scheda “Con l'assistente” e lascia che sia l'assistente a controllare e installare lo skill.

Con quali modelli AI funziona vitest?

Gli skill sono semplici istruzioni in Markdown (formato Agent Skills), quindi vitest funziona con qualsiasi agente che legge SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode e altri. Il modello carica le istruzioni solo quando il compito corrisponde alla descrizione dello skill.

vitest è gratuito?

Lo skill è pubblicato apertamente da antfu con licenza MIT. Lo skill in sé non costa nulla: paghi solo il tuo fornitore AI per i token usati.

È sicuro installare gli skill?

Uno skill è un insieme di istruzioni che il tuo agente seguirà: leggi SKILL.md e i file correlati prima di installarlo. Gli script nella cartella dello skill vengono eseguiti solo se li esegue l'agente: controlla cosa fa e non concedere permessi superflui.

In cosa differisce uno skill da un server MCP o da un plugin?

Un server MCP o un plugin danno al modello nuovi strumenti: codice che viene eseguito e restituisce un risultato. Uno skill fornisce conoscenza e metodo: come affrontare il compito, quali passi seguire e com'è un buon risultato. Non servono server né chiavi API.

Skill correlati

Tutti gli skill →