vitest

द्वारा sanity-io

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

npx skills add https://github.com/sanity-io/next-sanity --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

sanity-io की और Skills

performance-optimization
sanity-io
एप्लिकेशन के प्रदर्शन को अनुकूलित करता है। इसका उपयोग तब करें जब प्रदर्शन आवश्यकताएं हों, जब आपको प्रदर्शन में गिरावट का संदेह हो, या जब कोर वेब वाइटल्स या लोड समय...
official
rxjs-like-a-pro
sanity-io
यह कौशल आपको ऐसा RxJS कोड लिखने में मदद करता है जो स्वाभाविक, संयोजनीय और सामान्य कमियों से मुक्त हो। मुख्य दर्शन: तर्क को ऑब्ज़र्वेबल श्रृंखला में रखें। जब भी आप .subscribe() का उपयोग करने जाएं, तो पूछें कि क्या वह कार्य .pipe() के अंदर एक रूपांतरण के रूप में व्यक्त किया जा सकता है।
official
find-skills
sanity-io
उपयोगकर्ताओं को एजेंट कौशल खोजने और स्थापित करने में मदद करता है जब वे ऐसे प्रश्न पूछते हैं जैसे "मैं X कैसे करूं", "X के लिए कोई कौशल खोजें", "क्या कोई ऐसा कौशल है जो...", या व्यक्त करते हैं...
official
next-cache-components
sanity-io
Next.js 16 कैश घटक - PPR, use cache निर्देश, cacheLife, cacheTag, updateTag
official
vercel-react-best-practices
sanity-io
React और Next.js प्रदर्शन अनुकूलन दिशानिर्देश Vercel Engineering से। इस कौशल का उपयोग React/Next.js को लिखने, समीक्षा करने या रीफैक्टर करते समय किया जाना चाहिए…
official
frontend-design
sanity-io
उच्च डिज़ाइन गुणवत्ता के साथ विशिष्ट, उत्पादन-स्तर के फ्रंटएंड इंटरफ़ेस बनाएं। इस कौशल का उपयोग तब करें जब उपयोगकर्ता वेब घटकों, पृष्ठों या... बनाने के लिए कहे।
official
plugin-transfer
sanity-io
एजेंटों को कॉपी-प्लगइन जनरेटर वर्कफ़्लो के साथ मौजूदा प्लगइन को इस मोनोरिपो में स्थानांतरित करने का मार्गदर्शन देता है।
official
test-studio-script-runner
sanity-io
dev/test-studio स्क्रिप्ट रनर टूल की व्याख्या करता है। इसका उपयोग तब करें जब dev/test-studio/src/script-runner में स्क्रिप्ट जोड़ना, संपादित करना, चलाना या दस्तावेज़ीकरण करना हो, या जब...
official