vitest

द्वारा antfu

Vite द्वारा संचालित तेज़ यूनिट टेस्टिंग फ्रेमवर्क जिसमें Jest-संगत API है। टेस्ट लिखने, मॉकिंग, कवरेज कॉन्फ़िगर करने, या टेस्ट फ़िल्टरिंग और फिक्स्चर के साथ काम करते समय उपयोग करें।

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

expo-upgrade
expo
फ्रेमवर्क (ओपन सोर्स)। एक्सपो SDK संस्करणों को अपग्रेड करने और निर्भरता समस्याओं को ठीक करने के लिए दिशानिर्देश
apidevelopmenttesting
ui-sdk
vercel
React, Vue, Svelte, Solid या वेब कंपोनेंट्स में ui-sdk के साथ इंटरफ़ेस बनाता है। इसमें इसके कंपोनेंट चुनना और संयोजित करना, @ui-sdk/core से ऐसा कंपोनेंट या व्यवहार बनाना जो इसमें शामिल नहीं है (जैसे स्टेपर, स्प्लिटर, ट्रांसफ़र लिस्ट या इमोजी पिकर), createAgent, एजेंट टूल्स और WebMCP के ज़रिए इंटरफ़ेस को एजेंट्स के लिए उपयोगी बनाना, और कीबोर्ड, फ़ोकस, ARIA, सर्वर रेंडरिंग तथा दाएँ-से-बाएँ लेआउट की जाँच करना शामिल है; इसमें किसी मौजूदा कंपोनेंट के लिए टेस्ट लिखना भी शामिल है। जब भी किसी प्रोजेक्ट में @ui-sdk/*... हो, इसका उपयोग करें।
testingdesigndevelopment
workers-development
cloudflare
स्थानीय विकास के दौरान cf dev, wrangler dev या Cloudflare Vite plugin का उपयोग करके Cloudflare Workers चलाएँ, निरीक्षण करें और डीबग करें। Local Explorer से बाइंडिंग डेटा पढ़ें और सीड करें, तथा स्थानीय ट्रेस और लॉग क्वेरी करें। यह प्रोडक्शन डीबगिंग को Workers observability पर भी भेजता है। अनुरोधों को डीबग करने के लिए इसका उपयोग करें, चाहे प्रोजेक्ट Wrangler का उपयोग करता हो या नहीं।
devopstestingdevelopment
workers-profiling
cloudflare
तैनात Cloudflare Workers और Durable Objects में CPU उपयोग और मेमोरी आवंटन की प्रोफ़ाइल बनाएँ या डीबग करें। फिर इस जानकारी का उपयोग करके अपने कोड को अनुकूलित करें।
devopstestingdevelopment
accessibility
addyosmani
WCAG 2.2 दिशानिर्देशों का पालन करते हुए वेब पहुंच का ऑडिट और सुधार करें। इसका उपयोग तब करें जब "पहुंच में सुधार करें", "a11y ऑडिट", "WCAG अनुपालन", "स्क्रीन रीडर समर्थन", "कीबोर्ड नेविगेशन", या "सुलभ बनाएं" के लिए कहा जाए।
developmenttestingcode-review
accessibility-engineering
addyosmani
WCAG 2.2 AA अनुरूपता के लिए मौजूदा इंटरफ़ेस का ऑडिट करता है और पाई गई उल्लंघनों को ठीक करता है। किसी पेज या कंपोनेंट की पहुँच-योग्यता का ऑडिट करते समय, axe-core या pa11y चलाते समय, a11y उल्लंघनों की प्राथमिकता तय करते समय, या रिलीज़ से पहले स्क्रीन रीडर और कंट्रास्ट संबंधी समस्याओं की जाँच करते समय इसका उपयोग करें।
developmenttestingdesign
audit-website
squirrelscan
squirrelscan CLI के साथ वेबसाइट का ऑडिट करें और कोड में पाई गई समस्याओं को ठीक करें। SEO, प्रदर्शन, सुरक्षा, तकनीकी, सामग्री, पहुंच-योग्यता, और 15 अन्य नियम श्रेणियों (249+ नियम) को चलाता है, LLM-अनुकूलित रिपोर्ट लौटाता है, फिर एक पुनरावृत्त फिक्स लूप चलाता है, समस्याओं को स्रोत फ़ाइलों से मैप करता है, फिक्स लागू करता है, और साइट के अच्छे स्कोर होने तक फिर से ऑडिट करता है। वेबसाइट या वेबऐप समस्याओं को खोजने और मूल्यांकन करने तथा उन्हें ठीक करने के लिए उपयोग करें।
developmenttestingweb-scraping
better-accessibility
jakubkrehel
WCAG 2.2 के अनुसार कीबोर्ड और फ़ोकस व्यवहार, ARIA, सुलभ नाम, फ़ॉर्म, स्क्रीन रीडर घोषणाएँ, गति और ज़ूम की समीक्षा और सुधार करता है।
developmenttestingcode-review