{"id":"496874b5-ab8a-47f5-8bde-fe23c3d692ea","shortId":"pBsuDM","kind":"skill","title":"vitest","tagline":"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.","description":"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.\n\n**Key Features:**\n- Vite-native: Uses Vite's transformation pipeline for fast HMR-like test updates\n- Jest-compatible: Drop-in replacement for most Jest test suites\n- Smart watch mode: Only reruns affected tests based on module graph\n- Native ESM, TypeScript, JSX support without configuration\n- Multi-threaded workers for parallel test execution\n- Built-in coverage via V8 or Istanbul\n- Snapshot testing, mocking, and spy utilities\n\n> The skill is based on Vitest 3.x, generated at 2026-01-28.\n\n## Core\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Configuration | Vitest and Vite config integration, defineConfig usage | [core-config](references/core-config.md) |\n| CLI | Command line interface, commands and options | [core-cli](references/core-cli.md) |\n| Test API | test/it function, modifiers like skip, only, concurrent | [core-test-api](references/core-test-api.md) |\n| Describe API | describe/suite for grouping tests and nested suites | [core-describe](references/core-describe.md) |\n| Expect API | Assertions with toBe, toEqual, matchers and asymmetric matchers | [core-expect](references/core-expect.md) |\n| Hooks | beforeEach, afterEach, beforeAll, afterAll, aroundEach | [core-hooks](references/core-hooks.md) |\n\n## Features\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Mocking | Mock functions, modules, timers, dates with vi utilities | [features-mocking](references/features-mocking.md) |\n| Snapshots | Snapshot testing with toMatchSnapshot and inline snapshots | [features-snapshots](references/features-snapshots.md) |\n| Coverage | Code coverage with V8 or Istanbul providers | [features-coverage](references/features-coverage.md) |\n| Test Context | Test fixtures, context.expect, test.extend for custom fixtures | [features-context](references/features-context.md) |\n| Concurrency | Concurrent tests, parallel execution, sharding | [features-concurrency](references/features-concurrency.md) |\n| Filtering | Filter tests by name, file patterns, tags | [features-filtering](references/features-filtering.md) |\n\n## Advanced\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Vi Utilities | vi helper: mock, spyOn, fake timers, hoisted, waitFor | [advanced-vi](references/advanced-vi.md) |\n| Environments | Test environments: node, jsdom, happy-dom, custom | [advanced-environments](references/advanced-environments.md) |\n| Type Testing | Type-level testing with expectTypeOf and assertType | [advanced-type-testing](references/advanced-type-testing.md) |\n| Projects | Multi-project workspaces, different configs per project | [advanced-projects](references/advanced-projects.md) |","tags":["vitest","skills","antfu","agent-skills"],"capabilities":["skill","source-antfu","skill-vitest","topic-agent-skills","topic-skills"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/antfu/skills/vitest","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add antfu/skills","source_repo":"https://github.com/antfu/skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 4987 github stars · SKILL.md body (2,927 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:46.133Z","embedding":null,"createdAt":"2026-04-18T20:24:32.553Z","updatedAt":"2026-05-18T18:52:46.133Z","lastSeenAt":"2026-05-18T18:52:46.133Z","tsv":"'-01':151 '-28':152 '2026':150 '3':146 'advanc':307,322,335,349,363 'advanced-environ':334 'advanced-project':362 'advanced-type-test':348 'advanced-vi':321 'affect':105 'afteral':225 'aftereach':223 'api':14,46,181,192,195,208 'app':70 'aroundeach':226 'assert':209 'asserttyp':347 'asymmetr':215 'base':107,143 'beforeal':224 'beforeeach':222 'box':57 'built':127 'built-in':126 'cli':169,178 'code':261 'command':170,173 'compat':13,45,90 'concurr':188,285,286,293 'config':62,161,167,359 'configur':20,117,157 'context':273,283 'context.expect':276 'core':153,166,177,190,204,218,228 'core-c':176 'core-config':165 'core-describ':203 'core-expect':217 'core-hook':227 'core-test-api':189 'coverag':21,129,260,262,270 'custom':279,333 'date':240 'defineconfig':163 'describ':194,205 'describe/suite':196 'descript':155,233,309 'differ':358 'dom':332 'drop':92 'drop-in':91 'environ':325,327,336 'esm':49,112 'execut':125,289 'expect':207,219 'expecttypeof':345 'fake':317 'fast':3,82 'featur':72,231,245,257,269,282,292,304 'features-concurr':291 'features-context':281 'features-coverag':268 'features-filt':303 'features-mock':244 'features-snapshot':256 'file':300 'filter':26,295,296,305 'fixtur':28,275,280 'framework':6,36 'function':183,237 'generat':34,148 'graph':110 'group':198 'happi':331 'happy-dom':330 'helper':314 'hmr':84 'hmr-like':83 'hoist':319 'hook':221,229 'inlin':254 'integr':162 'interfac':172 'istanbul':133,266 'jest':12,44,89,97 'jest-compat':11,43,88 'jsdom':329 'jsx':52,114 'key':71 'level':342 'like':85,185 'line':171 'matcher':213,216 'mock':19,136,235,236,246,315 'mode':102 'modifi':184 'modul':109,238 'multi':119,355 'multi-project':354 'multi-thread':118 'name':299 'nativ':48,75,111 'nest':201 'next':33 'next-gener':32 'node':328 'option':175 'parallel':123,288 'pattern':301 'per':360 'pipelin':80 'plugin':66 'power':7,37 'project':353,356,361,364 'provid':41,267 'refer':156,234,310 'references/advanced-environments.md':337 'references/advanced-projects.md':365 'references/advanced-type-testing.md':352 'references/advanced-vi.md':324 'references/core-cli.md':179 'references/core-config.md':168 'references/core-describe.md':206 'references/core-expect.md':220 'references/core-hooks.md':230 'references/core-test-api.md':193 'references/features-concurrency.md':294 'references/features-context.md':284 'references/features-coverage.md':271 'references/features-filtering.md':306 'references/features-mocking.md':247 'references/features-snapshots.md':259 'replac':94 'rerun':104 'resolv':64 'shard':290 'share':59 'skill':141 'skill-vitest' 'skip':186 'smart':100 'snapshot':134,248,249,255,258 'source-antfu' 'spi':138 'spyon':316 'suit':99,202 'support':53,115 'tag':302 'test':5,18,25,35,86,98,106,124,135,180,191,199,250,272,274,287,297,326,339,343,351 'test.extend':277 'test/it':182 'thread':120 'timer':239,318 'tobe':211 'toequal':212 'tomatchsnapshot':252 'topic':154,232,308 'topic-agent-skills' 'topic-skills' 'transform':63,79 'type':338,341,350 'type-level':340 'typescript':50,113 'unit':4 'updat':87 'usag':164 'use':15,76 'util':139,243,312 'v8':131,264 'vi':242,311,313,323 'via':130 'vite':9,39,69,74,77,160 'vite-n':73 'vitest':1,2,29,58,145,158 'waitfor':320 'watch':101 'without':116 'work':23 'worker':121 'workspac':357 'write':17 'x':147","prices":[{"id":"90aeee81-6c67-4792-bdbc-823a7a66f359","listingId":"496874b5-ab8a-47f5-8bde-fe23c3d692ea","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"antfu","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:24:32.553Z"}],"sources":[{"listingId":"496874b5-ab8a-47f5-8bde-fe23c3d692ea","source":"github","sourceId":"antfu/skills/vitest","sourceUrl":"https://github.com/antfu/skills/tree/main/skills/vitest","isPrimary":false,"firstSeenAt":"2026-04-18T21:53:53.086Z","lastSeenAt":"2026-05-18T18:52:46.133Z"},{"listingId":"496874b5-ab8a-47f5-8bde-fe23c3d692ea","source":"skills_sh","sourceId":"antfu/skills/vitest","sourceUrl":"https://skills.sh/antfu/skills/vitest","isPrimary":true,"firstSeenAt":"2026-04-18T20:24:32.553Z","lastSeenAt":"2026-05-07T22:40:14.834Z"}],"details":{"listingId":"496874b5-ab8a-47f5-8bde-fe23c3d692ea","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"antfu","slug":"vitest","github":{"repo":"antfu/skills","stars":4987,"topics":["agent-skills","skills"],"license":"mit","html_url":"https://github.com/antfu/skills","pushed_at":"2026-05-01T16:46:24Z","description":"Anthony Fu's curated collection of agent skills.","skill_md_sha":"0578bdcf3a870e53b69eb0d5bb4795151b0d217e","skill_md_path":"skills/vitest/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/antfu/skills/tree/main/skills/vitest"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"vitest","description":"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."},"skills_sh_url":"https://skills.sh/antfu/skills/vitest"},"updatedAt":"2026-05-18T18:52:46.133Z"}}