vitest

por antfu

Framework de testes unitários rápidos Vitest, alimentado pelo Vite, com API compatível com Jest. Use ao escrever testes, fazer mocking, configurar cobertura ou trabalhar com filtragem de testes e fixtures.

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.0.1, generated at 2026-09-25.

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

Skills relacionadas

aws-sdk-python-usage
aws
Padrões de desenvolvimento do AWS SDK para Python (boto3/botocore). Você DEVE usar esta skill ao escrever código Python que utiliza serviços da AWS via boto3 ou botocore. Este…
dev-workflow
contentstack
Use para scripts npm, CI e fluxo de release no contentstack-marketplace-sdk.
posthog-desktop
posthog
Os escopos funcionam para o aplicativo desktop em products/desktop — um workspace aninhado e independente de pnpm/turbo/Biome importado de PostHog/code, que não faz parte do frontend raiz…
run-posthog
posthog
Iniciar, inspecionar e gerenciar a stack de desenvolvimento do PostHog. Use para /run e /verify neste repositório — quando solicitado a iniciar o PostHog, verifique se a stack está saudável,…
test-triage
openai
Triagem de testes macOS com falha em fluxos de trabalho Xcode e SwiftPM. Use quando solicitado a executar testes macOS, restringir escopos de falha, explicar falhas de asserção ou travamentos,…
osmo-user
nvidia
Dirigir a CLI do OSMO para computação de robótica em nuvem em nome de um usuário final: verificar recursos, enviar/monitorar/depurar/explicar fluxos de trabalho, buscar logs e…
runcomfy-cli
doany-ai
Run any model on RunComfy from the command line. The `runcomfy` CLI is one binary, one auth, hundreds of model endpoints — image generation, image edit, video generation, image-to-video, lip-sync, face swap, video edit, inpainting, outpainting, extend, ControlNet, relight, upscale, LoRA training and more. Submit a request, poll for status, download the output. This skill teaches the agent how to install, authenticate, discover model schemas, invoke models, stream / poll / no-wait, script in...
creativemediaapi
go-codemod
github
Implemente e teste codemods Go para o comando gh aw fix.