vitest

por antfu

Marco de pruebas unitarias rápidas impulsado por Vite con API compatible con Jest. Úselo al escribir pruebas, simular, configurar cobertura o trabajar con filtrado de pruebas y 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). Pautas para actualizar las versiones del SDK de Expo y solucionar problemas de dependencias
apidevelopmenttesting
ui-sdk
vercel
Crea interfaces con ui-sdk en React, Vue, Svelte, Solid o componentes web. Abarca la elección y composición de sus componentes, la creación de un componente o comportamiento que no incluya, a partir de @ui-sdk/core (como un indicador de pasos, un divisor, una lista de transferencia o un selector de emojis), la adaptación de la interfaz para que los agentes puedan usarla mediante createAgent, herramientas de agente y WebMCP, y las pruebas de teclado, foco, ARIA, renderizado en servidor y escritura de derecha a izquierda, incluida la creación de pruebas para un componente existente. Úsalo siempre que un proyecto tenga @ui-sdk/*...
testingdesigndevelopment
workers-development
cloudflare
Ejecuta, inspecciona y depura Cloudflare Workers durante el desarrollo local con cf dev, wrangler dev o el plugin de Cloudflare para Vite. Usa Local Explorer para leer y cargar datos de bindings, y consultar trazas y registros locales. También dirige la depuración en producción a la observabilidad de Workers. Úsalo para depurar solicitudes, tanto si el proyecto usa Wrangler como si no.
devopstestingdevelopment
workers-profiling
cloudflare
Perfila o depura el uso de CPU y la asignación de memoria en Cloudflare Workers y Durable Objects implementados. Luego, usa esta información para optimizar tu código.
devopstestingdevelopment
accessibility
addyosmani
Auditar y mejorar la accesibilidad web siguiendo las pautas WCAG 2.2. Úsalo cuando se te pida "mejorar la accesibilidad", "auditoría a11y", "cumplimiento WCAG", "compatibilidad con lectores de pantalla", "navegación por teclado" o "hacer accesible".
developmenttestingcode-review
accessibility-engineering
addyosmani
Audita interfaces existentes para verificar su conformidad con WCAG 2.2 AA y corrige las infracciones detectadas. Úsalo al auditar la accesibilidad de una página o un componente, ejecutar axe-core o pa11y, priorizar infracciones de accesibilidad o comprobar problemas con lectores de pantalla y de contraste antes del lanzamiento.
developmenttestingdesign
audit-website
squirrelscan
Auditar un sitio web con la CLI de squirrelscan y corregir los hallazgos en el código. Ejecuta categorías de reglas de SEO, rendimiento, seguridad, técnicas, contenido, accesibilidad y otras 15 (más de 249 reglas), devuelve un informe optimizado para LLM, luego impulsa un bucle de corrección iterativo, mapeando problemas a archivos fuente, aplicando correcciones y reauditando hasta que el sitio obtenga buenos puntajes. Úselo para descubrir y evaluar problemas en sitios web o aplicaciones web y llevarlos a su corrección.
developmenttestingweb-scraping
better-accessibility
jakubkrehel
Revisa y corrige el comportamiento del teclado y el foco, ARIA, los nombres accesibles, los formularios, los anuncios para lectores de pantalla, el movimiento y el zoom según WCAG 2.2.
developmenttestingcode-review