vitest-testing
Skill0 starsChanged yesterdayMITView on GitHub
Configure or debug Vitest suites, mocks, pools, isolation, coverage, sharding, flaky tests, or test performance.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- axross/skillstheir own version, first seen Oct 13, 2026
- TangleML/tangle-uitheir own version, first seen Oct 8, 2026
- revealui-studio/revskillstheir own version, first seen Sep 22, 2026
- RevealUIStudio/revskillstheir own version, first seen Sep 22, 2026
- yutakobayashidev/skillstheir own version, first seen Jun 1, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- TangleML/tangle-ui★ 104same name
- revealui-studio/revskills★ 2same name
- RevealUIStudio/revskills★ 2same name
- axross/skills★ 1same name
- yutakobayashidev/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- astroSkill
- bun-standardsSkill
- postgresSkill
- react-engineeringSkill
- rust-standardsSkill
- spring-bootSkill
- tailwind-v4Skill
- typescript-standardsSkill
- api-designSkill
- architecture-reviewSkill
- benchmark-readiness-reviewSkill
- cli-designSkill
- codebase-scoutingSkill
- code-review-findingsSkill
- config-projection-reviewSkill
- documentation-hygieneSkill
- domain-modelingSkill
- formal-verificationSkill
- implementation-planningSkill
- orchestration-workflowSkill
- problem-clarificationSkill
- product-copySkill
- refactorSkill
- repository-text-hygieneSkill
- researchSkill
- security-scope-reviewSkill
- setup-canastaSkill
- system-designSkill
- task-closeoutSkill
- tddSkill
- technical-writingSkill
- upstream-contributionSkill
- writing-issuesSkill
- writing-prSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 13 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use Vitest as a behavior-verification tool, not a test-count generator.
- Distinctive: line 14
Before changing tests or configuration:
- Distinctive: line 17
Read package scripts, every effective project config, setup/global-setup files, CI topology, supported runtimes, and existing performance …
- Distinctive: line 30
Use the narrowest layer that can faithfully observe the behavior.
- Distinctive: line 34
Keep fixtures synthetic, portable, minimal, and owned by the boundary under test.
- Distinctive: line 38
Do not enable global mock reset options mechanically.
- Distinctive: line 43
Keep runtime tests separate when behavior depends on Bun, workerd, a browser, Node, or another deployed runtime.
- Distinctive: line 45
Keep TypeScript compilation/typechecking as a separate explicit gate unless a repository has intentionally adopted Vitest type tests for a …
- Very specific: line 69
Do not use isolate: false, another pool, VM pools, sharding, or more workers as generic speed switches.
- Distinctive: line 72
Keep isolation unless a stateless bounded project passes repeated shuffled and order-dependence probes.
- Very specific: line 74
Keep forks as the safe starting point.
- Distinctive: line 92
Use focused files during the inner loop, then the owning package/suite, affected downstream suites, and repository-required gates before …
- Distinctive: line 108
Use targeted mutation testing when assertion sensitivity on changed/high-risk code is uncertain.
- Distinctive: line 111
Use JSON or other machine-readable duration output for concentration analysis.
- Distinctive: line 112
Use hanging-process diagnostics only while debugging because they are expensive.
- Distinctive: line 113
Treat CPU/heap profiles, traces, reports, and attachments as sensitive.
- Very specific: line 119
When Bun is the package manager, bun run test selects the configured Vitest script.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vitest Testing
Use Vitest as a behavior-verification tool, not a test-count generator. Route
behavior slicing, oracle quality, redundancy, and red-green-refactor decisions
through tdd.
Resolve the effective suite
Before changing tests or configuration:
- Resolve the installed Vitest, Vite, Node, and coverage-provider versions.
- Read package scripts, every effective project config, setup/global-setup files, CI topology, supported runtimes, and existing performance evidence. Projects do not necessarily inherit root options.
- Map which tests own pure behavior, integration state, runtime compatibility, browser behavior, contracts, and end-to-end journeys.
- Identify the correctness invariants behind isolation, worker caps, ordering, environment choice, and custom pools before tuning them.
- For Vitest 4.1 specifics and current caveats, read references/vitest-4.1.md. Recheck official docs and tagged source when the resolved version differs or docs conflict.
Add or change tests
- Use the narrowest layer that can faithfully observe the behavior. Prefer the existing owner over a parallel assertion in a new file.
- Pair
-twith a file path when known; name filtering alone can still load many files for discovery. - Keep fixtures synthetic, portable, minimal, and owned by the boundary under test. Use isolated temporary resources for filesystem/database behavior.
- Mock at a real boundary only when the fake preserves the semantics the test needs. Restore mocks, timers, environment, globals, cwd, and resources.
- Do not enable global mock reset options mechanically; they can change concurrent test semantics and hide local ownership.
- During Vitest 3/Jest to Vitest 4 migration, distinguish clear, reset, and restore
semantics.
vi.restoreAllMocksno longer clears spy state and does not restore automocks; add a cross-test contamination probe before relying on global cleanup. - Keep runtime tests separate when behavior depends on Bun, workerd, a browser, Node, or another deployed runtime. Runner compatibility is not runtime proof.
- Keep TypeScript compilation/typechecking as a separate explicit gate unless a repository has intentionally adopted Vitest type tests for a distinct contract.
Diagnose speed before tuning
Capture repeated baselines and use Vitest's transform, setup, import, tests, and
environment buckets to find the owner. Agent-aware reporters can hide these buckets;
temporarily select --reporter=default or default plus JSON/outputFile for diagnosis.
An explicit reporter disables automatic GitHub Actions reporter insertion, so include
github-actions explicitly when annotations are required. Then apply the matching
lever:
- Slow import/transform: inspect import durations and broad barrels; reduce the graph at ownership boundaries. Use dependency optimization only for a measured costly external dependency.
- Slow setup/environment: measure per-file setup.
globalSetuphas a separate scope and is not a semantics-preserving replacement forsetupFiles. - Slow test bodies: remove real waits, excessive subprocesses/network, redundant setup, or unsuitable fixture scope while preserving the real contract.
- CPU contention: budget workers across all concurrently running packages, pools, services, and CI jobs. Benchmark fixed budgets on the target host.
- Memory pressure or hangs: profile with a simplified worker topology and a watchdog. Lower concurrency only after distinguishing leaks from contention.
Do not use isolate: false, another pool, VM pools, sharding, or more workers as
generic speed switches. Each changes resource use or semantics:
- Keep isolation unless a stateless bounded project passes repeated shuffled and order-dependence probes.
- Keep
forksas the safe starting point. Trythreadsonly whereprocess.chdir, native modules, process isolation, and runtime globals are not required. - Shards divide files, not individual tests. Measure duration skew and duplicated
setup/install cost before distributing them. Blob merge is run-mode only and
excludes attachments; collect/merge
attachmentsDirseparately and verify shard, test, report, and artifact counts. - Persistent filesystem module cache is a local fast-feedback experiment until source, alias, plugin-option, environment, and config invalidation are proven.
For performance comparisons, state the correctness invariant, versions, host,
cache state, seed/order, reporter, maxWorkers, file parallelism, pool, concurrent
package/service topology, and memory pressure. Hold them constant; separate cold
and warm runs, interleave variants, warm up when appropriate, and report median plus
spread or p95 across repeated samples. Record failures, retries, hangs, RSS, and
semantic parity. One favorable run is not a performance result.
Fast feedback versus proof
- Use focused files during the inner loop, then the owning package/suite, affected downstream suites, and repository-required gates before completion.
relatedand--changedfollow discoverable dependency evidence and can miss dynamic imports, registration, configuration, generated projections, and filesystem discovery. They are acceleration, never the only authority.- Watch mode is for development; use explicit
vitest runin CI. - A retry-pass is evidence of flakiness, not success. Repair nondeterminism or quarantine it with an owner, reason, expiry/removal condition, and deterministic alternate gate.
Coverage and diagnostics
- Coverage shows exercised code, not assertion quality. Define the intended source surface explicitly; loaded-file-only coverage can omit unimported production code.
- Preserve thresholds and semantics when comparing V8 and Istanbul. Profile the actual suite; neither provider is universally faster.
- Use targeted mutation testing when assertion sensitivity on changed/high-risk code is uncertain. Interpret surviving and equivalent mutants; avoid global score chasing.
- Use JSON or other machine-readable duration output for concentration analysis. Use hanging-process diagnostics only while debugging because they are expensive.
- Treat CPU/heap profiles, traces, reports, and attachments as sensitive. Prefer synthetic workloads, ignored/access-limited paths, bounded retention, and content review/redaction before upload, commit, issue attachment, or model input.
Bun boundary
When Bun is the package manager, bun run test selects the configured Vitest
script; bun test invokes Bun's separate runner. The script command does not prove
the runtime: inspect [run].bun, flags, Node availability, process.execPath, and
reported versions. Do not force Vitest onto Bun's runtime without bounded
compatibility and performance evidence. Use bun-standards to choose a native-Bun,
Vitest, or hybrid portfolio.
Completion
Report behavior exercised and evidence established, effective config/version, focused and broader gates, timing protocol and distribution for performance claims, and residual untested runtime or integration risks. Do not equate passing, coverage, or test count with correctness.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

