Individual skill
vitest
Vitest testing framework patterns for test setup, async testing, mocking with vi.*, snapshots, and test performance (formerly test-vitest). This skill should be used when writing or debugging Vitest tests. This skill does NOT cover TDD methodology (use test-tdd skill), API mocking with MSW (use test-msw skill), or Jest-specific APIs.
skills/.curated/vitest/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 223
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 9,672 bytesCHANGELOG.mddoc · 699 bytesREADME.mddoc · 3,471 bytesSKILL.mdcore · 5,084 bytesSKILL.mdcore · 5,084 bytesassets/templates/_template.mddoc · 888 bytesmetadata.jsonasset · 949 bytesreferences/_sections.mddoc · 1,984 bytesreferences/assert-edge-cases.mddoc · 2,307 bytesreferences/assert-expect-assertions.mddoc · 2,345 bytesreferences/assert-one-assertion-concept.mddoc · 2,622 bytesreferences/assert-specific-matchers.mddoc · 2,171 bytesreferences/assert-toequal-vs-tobe.mddoc · 2,186 bytesreferences/async-act-wrapper.mddoc · 2,453 bytesreferences/async-await-assertions.mddoc · 1,319 bytesreferences/async-concurrent-expect.mddoc · 1,916 bytesreferences/async-error-handling.mddoc · 2,107 bytesreferences/async-fake-timers.mddoc · 2,013 bytesreferences/async-return-promises.mddoc · 1,540 bytesreferences/async-waitfor-polling.mddoc · 1,832 bytesreferences/env-browser-api-mocking.mddoc · 2,273 bytesreferences/env-globals-config.mddoc · 1,825 bytesreferences/env-per-file-override.mddoc · 2,146 bytesreferences/env-setup-files.mddoc · 2,349 bytesreferences/mock-avoid-overmocking.mddoc · 2,908 bytesreferences/mock-clear-between-tests.mddoc · 2,199 bytesreferences/mock-implementation-not-value.mddoc · 2,361 bytesreferences/mock-msw-network.mddoc · 2,682 bytesreferences/mock-spyon-vs-mock.mddoc · 2,478 bytesreferences/mock-type-safety.mddoc · 2,498 bytesreferences/mock-vi-mock-hoisting.mddoc · 2,151 bytesreferences/org-describe-nesting.mddoc · 2,490 bytesreferences/org-file-colocation.mddoc · 1,746 bytesreferences/org-test-naming.mddoc · 2,072 bytesreferences/org-test-skip-only.mddoc · 1,822 bytesreferences/perf-bail-fast-fail.mddoc · 1,778 bytesreferences/perf-disable-isolation.mddoc · 2,085 bytesreferences/perf-happy-dom.mddoc · 1,954 bytesreferences/perf-pool-selection.mddoc · 1,987 bytesreferences/perf-run-mode-ci.mddoc · 1,649 bytesreferences/perf-sharding.mddoc · 2,006 bytesreferences/setup-avoid-shared-state.mddoc · 2,547 bytesreferences/setup-beforeall-expensive.mddoc · 2,336 bytesreferences/setup-beforeeach-cleanup.mddoc · 1,980 bytesreferences/setup-reset-modules.mddoc · 2,601 bytesreferences/setup-restore-mocks.mddoc · 2,133 bytesreferences/setup-test-factories.mddoc · 2,913 bytesreferences/snap-avoid-large.mddoc · 2,333 bytesreferences/snap-describe-intent.mddoc · 2,129 bytesreferences/snap-inline-over-file.mddoc · 1,925 bytesreferences/snap-review-updates.mddoc · 1,893 bytesreferences/snap-stable-serialization.mddoc · 2,342 bytes
Read excerpt
# Vitest Best Practices
Comprehensive performance optimization and best practices guide for Vitest testing framework. Contains 44 rules across 8 categories, prioritized by impact to guide test writing, refactoring, and code review.
## When to Apply
Reference these guidelines when:
- Writing new Vitest tests
- Debugging flaky or slow tests
- Setting up test configuration
- Reviewing test code in PRs
- Migrating from Jest to Vitest
- Optimizing CI/CD test performance