vitest

โดย supabase

เฟรมเวิร์กการทดสอบหน่วยความเร็วสูง Vitest ที่ขับเคลื่อนโดย Vite พร้อม API ที่เข้ากันได้กับ Jest ใช้เมื่อเขียนทดสอบ, สร้างม็อก, กำหนดค่าความครอบคลุม, หรือทำงานกับทดสอบ…

npx skills add https://github.com/supabase/supabase --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 เพิ่มเติมจาก supabase

studio-e2e-tests
supabase
เขียนและรันการทดสอบ E2E ด้วย Playwright สำหรับ Supabase Studio ใช้เมื่อถูกถาม
pm-the-docs
supabase
Docs-PM การสนับสนุนการตัดสินใจสำหรับกระบวนการเขียน "Write the docs" — ช่วยตัดสินใจเกี่ยวกับกลุ่มผู้ชม ขั้นตอน และขอบเขตงานแบบครอบคลุมในช่วง Frame และ Shape stages,…
studio-best-practices
supabase
แนวทางปฏิบัติที่ดีที่สุดสำหรับ React และ TypeScript สำหรับ Supabase Studio ใช้เมื่อเขียนหรือตรวจสอบคอมโพเนนต์ของ Studio — ครอบคลุมการตั้งชื่อบูลีน โครงสร้างคอมโพเนนต์…
docs-content
supabase
เขียน แก้ไข จัดระเบียบ และตรวจสอบเนื้อหา Supabase ทุกที่ใน apps/docs — คู่มือ บทอธิบาย บทช่วยสอน รายการแก้ไขปัญหา เอกสารอ้างอิง และ…
studio-mock-api-tests
supabase
การทดสอบคอมโพเนนต์สำหรับ Supabase Studio ที่จำลองคำขอ API ที่ชั้นเครือข่ายด้วย MSW ใช้เมื่อเขียนหรือตรวจสอบการทดสอบคอมโพเนนต์ที่ใช้งาน React…
studio-ui-patterns
supabase
ดีไซน์ซิสเต็ม UI แพตเทิร์นสำหรับ Supabase Studio ใช้เมื่อสร้างหรืออัปเดตหน้าเพจ ฟอร์ม ตาราง แผนภูมิ สถานะว่าง การนำทาง การ์ด การแจ้งเตือน หรือไซด์…
react-hook-form
supabase
แก้ไขการใช้งาน React Hook Form ให้ถูกต้องทุกที่ใน monorepo — data flow, subscriptions, reset, dirty state, number inputs, และกฎของ controlled-input. โหลดสิ่งนี้…
studio-queries
supabase
ข้อกำหนดของ React Query สำหรับการดึงข้อมูลใน Supabase Studio ใช้เมื่อเขียนหรือตรวจสอบ query hooks, mutation hooks หรือ query keys ใน apps/studio/data/ —…