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.1.0-beta.1, generated at 2026-10-23.

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

expo-upgrade
expo
Framework (OSS). Diretrizes para atualizar versões do SDK Expo e corrigir problemas de dependência.
apidevelopmenttesting
ui-sdk
vercel
Cria interfaces com ui-sdk em React, Vue, Svelte, Solid ou web components. Abrange a escolha e a composição de seus componentes, a criação de um componente ou comportamento que não vem incluído em @ui-sdk/core (como um stepper, splitter, lista de transferência ou seletor de emojis), a disponibilização da interface para agentes por meio de createAgent, ferramentas de agente e WebMCP, e testes de teclado, foco, ARIA, renderização no servidor e escrita da direita para a esquerda, incluindo testes para um componente existente. Use sempre que um projeto tiver @ui-sdk/*...
testingdesigndevelopment
workers-development
cloudflare
Execute, inspecione e depure Cloudflare Workers durante o desenvolvimento local com cf dev, wrangler dev ou o plugin Vite da Cloudflare, usando o Local Explorer para ler e inserir dados de bindings e consultar traces e logs locais. Também direciona a depuração em produção para a observabilidade do Workers. Use para depurar requisições, independentemente de o projeto usar Wrangler.
devopstestingdevelopment
workers-profiling
cloudflare
Analise o perfil ou depure o uso da CPU e a alocação de memória em Cloudflare Workers e Durable Objects implantados. Em seguida, use essas informações para otimizar seu código.
devopstestingdevelopment
accessibility
addyosmani
Auditar e melhorar a acessibilidade web seguindo as diretrizes WCAG 2.2. Use quando solicitado a "melhorar a acessibilidade", "auditoria de a11y", "conformidade com WCAG", "suporte a leitores de tela", "navegação por teclado" ou "tornar acessível".
developmenttestingcode-review
accessibility-engineering
addyosmani
Audita interfaces existentes quanto à conformidade com WCAG 2.2 AA e corrige as violações encontradas. Use ao auditar uma página ou componente quanto à acessibilidade, executar axe-core ou pa11y, priorizar violações de acessibilidade ou verificar problemas com leitores de tela e contraste antes do lançamento.
developmenttestingdesign
audit-website
squirrelscan
Audite um site com a CLI squirrelscan e corrija os resultados no código. Executa SEO, desempenho, segurança, aspectos técnicos, conteúdo, acessibilidade e outras 15 categorias de regras (mais de 249 regras), retorna um relatório otimizado para LLM e, em seguida, conduz um loop iterativo de correção, mapeando problemas para arquivos de origem, aplicando correções e reauditando até que o site obtenha uma boa pontuação. Use para descobrir e avaliar problemas em sites ou aplicativos web e resolvê-los.
developmenttestingweb-scraping
better-accessibility
jakubkrehel
Revisa e corrige o comportamento do teclado e do foco, ARIA, nomes acessíveis, formulários, anúncios para leitores de tela, movimento e zoom de acordo com a WCAG 2.2.
developmenttestingcode-review