vitest

โดย antfu

Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and 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 3.x, generated at 2026-01-28.

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

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 ที่เกี่ยวข้อง

ai-elements
vercel
คู่มือไลบรารีส่วนประกอบ AI Elements — ส่วนประกอบ React ที่สร้างไว้ล่วงหน้าสำหรับอินเทอร์เฟซ AI ที่สร้างบน shadcn/ui ใช้เมื่อสร้าง UI แชท การแสดงข้อความ เครื่องมือ…
official
flux-kontext
agentspace-so
แก้ไขภาพด้วย Flux 1 Kontext Pro (โมเดลแก้ไขภาพเฉพาะจุดที่แม่นยำจาก Black Forest Labs) บน RunComfy — มาพร้อมกับรูปแบบการเขียนคำสั่งที่บันทึกไว้ของโมเดล เพื่อให้สกิลได้ผลลัพธ์ที่คมชัดกว่าการใช้คำสั่งแบบทั่วไปกับโมเดลเดียวกัน บันทึกจุดแข็งของ Flux Kontext (การแก้ไขเฉพาะจุดที่แม่นยำจากภาพอ้างอิงเดียว, การควบคุมคำสั่งที่แข็งแกร่ง, ผลลัพธ์คุณภาพสูงที่สม่ำเสมอ), โครงสร้าง (ภาพเดียว + คำสั่ง), และเวลาที่ควรเปลี่ยนไปใช้ Nano Banana Edit / GPT Image 2 edit / Flux 2 Klein แทน เรียก...
creativeimagedesign
Writing Hookify Rules
anthropic
Define patterns and messages that trigger Claude warnings or blocks on specific agent actions. Supports four event types (bash commands, file edits, agent stop, user prompts) plus an "all" catch-all, each with regex or multi-condition matching Rules use markdown files with YAML frontmatter stored in .claude/hookify.{name}.local.md ; changes take effect immediately on next tool use Two matching modes: simple pattern field for single-condition rules, or advanced conditions array for...
official
pdf
anthropic
ชุดเครื่องมือจัดการ PDF ที่ครอบคลุมสำหรับการแยกข้อความและตาราง สร้าง PDF ใหม่ รวม/แยกเอกสาร และจัดการฟอร์ม เมื่อ Claude ต้องการ...
official
upstash-redis-start
upstash
Provision a zero-config, no-signup Upstash Redis database for an AI agent via a single POST to `https://upstash.com/start-redis`. Use when an agent needs…
official
prisma-database-setup-sqlserver
prisma
SQL Server Setup. Reference when using this Prisma feature.
official
gh-review-requests
sentry
ดึงการแจ้งเตือน GitHub ที่ยังไม่ได้อ่านสำหรับ PR ที่เปิดอยู่ซึ่งมีการขอรีวิวจากทีมที่ระบุหรือเปิดโดยสมาชิกในทีม ใช้เมื่อถูกขอให้ "ค้นหา PR ที่ฉันต้อง…
official
golang-project-layout
samber
ให้คำแนะนำในการจัดโครงสร้างโปรเจกต์และเวิร์กสเปซของ Golang ใช้เมื่อเริ่มโปรเจกต์ Go ใหม่ จัดระเบียบโค้ดเบสที่มีอยู่ ตั้งค่า monorepo ที่มีหลายแพ็กเกจ สร้างเครื่องมือ CLI ที่มีหลาย main package ตัดสินใจระหว่างรูปแบบไดเรกทอรี cmd/internal/pkg หรือพูดถึงการปรับโครงสร้างแพ็กเกจ การแยกแพ็กเกจ หรือการแยกโมดูล
development