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 vitestVitest 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
| 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 |
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 |
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