vitest
Vitest knowledge for writing, running, debugging, and reviewing TypeScript/JavaScript unit and integration tests — test structure (describe/it/test), hooks…
Skill by MisterIcy
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mistericy-vitest
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, devops, data, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/vitest
What's inside
- Skill name
vitest- Description
- Vitest knowledge for writing, running, debugging, and reviewing TypeScript/JavaScript unit and integration tests — test structure (describe/it/test), hooks, data-driven tests (it.each), async assertions, fixtures (test.extend), mocking (vi.fn/vi.spyOn/vi.mock/vi.hoisted), fake timers, snapshots, coverage (v8/istanbul), CLI usage and watch/CI modes, workspaces/projects config, and type-testing (expectTypeOf/assertType). Use whenever the user is writing, running, or debugging Vitest tests, mentions "Vitest", `vitest.config.ts`, `vi.mock`/`vi.fn`, `.test.ts`/`.spec.ts` in a TS/JS project, or asks to improve/review an existing Vitest suite.
- License
- Apache-2.0
- Instructions
- 95 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (10)
- SKILL.md
- evals.json · evals/
- cli-and-config.md · references/
- coverage.md · references/
- mocking.md · references/
- review-checklist.md · references/
- snapshots.md · references/
- type-testing.md · references/
- writing-tests.md · references/
- detect-runner.sh · scripts/
SKILL.md (first lines)
# Vitest
Reference knowledge for anyone writing, running, debugging, or reviewing
Vitest tests in a TypeScript/JavaScript codebase — not a general JS testing
tutorial, and not for other test runners (Jest, Mocha, Jasmine) even though
much of the API is intentionally Jest-compatible.
## Workflow
1. **Confirm this is a Vitest project.** Look for `vitest` in
`package.json` (dependencies or devDependencies), a `vitest.config.*` /
`vitest.workspace.*` file, or a `test` block inside `vite.config.*`. Run
`scripts/detect-runner.sh <project-root>` to get the package manager,
suggested invocation, and any config files found — use its output to
pick the right command instead of guessing `npx vitest`.
2. **Load the reference file(s) the task actually needs** — don't load all
of them for a narrow question:
- `references/writing-tests.md` — describe/it/test structure, hooks,
`it.each` data-driven tests, async assertions, `test.extend` fixtures,
concurrent tests, in-source testing.
- `references/cli-and-config.md` — CLI flags, watch vs. `run` mode,
`vitest.config.ts` shape, environments (node/jsdom/happy-dom),
workspaces/projects, reporters, CI integration.
- `references/mocking.md` — `vi.fn`/`vi.spyOn`, module mocking with
`vi.mock` and hoisting (`vi.hoisted`), partial mocks, fake timers,
`vi.stubGlobal`/`vi.stubEnv`.
- `references/snapshots.md` — file vs. inline snapshots, updating with
`-u`, custom serializers, when a snapshot is the wrong tool.
- `references/coverage.md` — `--coverage`, v8 vs. istanbul providers,
thresholds, reading coverage as a signal rather than a goal.
- `references/type-testing.md` — `expectTypeOf`/`assertType`,
`*.test-d.ts` files, running with `--typecheck`.
- `references/review-checklist.md` — anti-patterns to check for when
asked to review/audit an *existing* suite rather than write new tests.
3. **Writing tests**: match the existing repo's conventions (`test` vs.
`it`, explicit imports vs. `globals: true`, fixture style) before
introducing a different one — check a neighboring test file first, not
just the config. Use `it.each`/fixtures/hooks per `writing-tests.md`
rather than hand-rolled loops or repeated setup.
4. **Running tests**: always use `vitest run` (not bare `vitest`, which
enters watch mode and will hang a non-interactive shell) for a one-shot
verification pass. Add `--coverage`/`--typecheck`/`-t <pattern>` as the
task requires.
5. **Reviewing/debugging an existing suite**: read the actual test files,
not just whether the suite currently passes. Walk
`references/review-checklist.md` explicitly — un-awaited async
assertions, leaked mocks/timers, concurrent tests sharing mutable state,
and snapshot-only tests with no semantic assertion are the highest-value
things to catch, because they can pass green while masking a real bug.
6. **Prefer this skill's condensed knowledge first**, but every topic file
ends with a `Source` line to the exact vitest.dev page it was drawn
from — fetch that page directly if the user's installed version behaves
differently than described (Vitest's API has been broadly stable across
major versions for everything covered here; this skill deliberately does
not version-gate the way `phpunit` does, since Vitest hasn't had
comparable breaking churn in the surface this skill covers — if a
genuine version-specific discrepancy shows up, note it explicitly rather
than silently guessing).
## Common mistakes to avoid
- Running bare `vitest` in a script/CI context expecting a single pass —
it enters watch mode and hangs. Use `vitest run`.
- Referencing outer-scope `const`/`let` variables inside a `vi.mock(...)`
factory without `vi.hoisted()` — `vi.mock` calls are hoisted above
imports and regular variable declarations, so this throws or silently
uses `undefined`.
- Treating a green suite as a good suite during review — walk
`review-checklist.md` explicitly rather than trusting pass/fail alone.
- Updating snapshots (`-u`) reflexively to clear a failure instead of
confirming the underlying output change was intended.
- Loading every reference file for a single narrow question — load only
the topic file(s) the task needs.
- Confusing this skill with a general JS/TS testing tutorial — it assumes
the reader already knows TypeScript and just needs Vitest-specific
mechanics.
## References
- `references/writing-tests.md`
- `references/cli-and-config.md`
- `references/mocking.md`
- `references/snapshots.md`
- `references/coverage.md`
- `references/type-testing.md`
- `references/review-checklist.md`
- `scripts/detect-runner.sh` — reports package manager, suggested Vitest
invocation, and discovered config files for a project rootFrom MisterIcy/provenance, Apache-2.0.
More from MisterIcy/provenance
- 0.529score
ddd-engineer
MisterIcy
Domain-Driven-Design engineering orchestrator.
SkillBFreshness: BClaude Code - 0.529score
phpunit
MisterIcy
PHPUnit knowledge for writing, running, debugging, and improving tests — writing tests, the CLI test runner, fixtures/setup-teardown, test organization…
SkillBFreshness: BClaude Code +9 - 0.529score
reconciler
MisterIcy
Reconciles a GitHub stacked pull-request chain or a numerically-suffixed branch train (e.g.
SkillBFreshness: BClaude Code - 0.529score
skill-creator
Alexandros Koutroulis
Scaffolds and reviews Agent Skills (SKILL.md packages) following the open agentskills.io standard, with extra guidance for Claude Code.
SkillBFreshness: BClaude Code +9 - 0.529score
subagent-creator
Alexandros Koutroulis
Scaffolds and reviews Claude Code subagents (Markdown files with YAML frontmatter under agents/ directories) — specialized helpers with their own system…
SkillBFreshness: BClaude Code +9 - 0.529score
git-committer
MisterIcy
Discovers the current git diff, groups related changes into logically separate commits, and writes Conventional Commits-formatted messages in plain…
SkillBFreshness: BClaude Code +9 - 0.529score
git-committer-setup
MisterIcy
One-time (or refresh) setup for the git-committer skill — ingests the N most recent commits by the current git author and writes a personalized commit-message…
SkillBFreshness: BClaude Code +9 - 0.525score
mariadb-sql
MisterIcy
MariaDB-specific SQL dialect knowledge — correctness pitfalls (NULL/GROUP BY/collation semantics), performance (optimizer, indexes, EXPLAIN reading)…
SkillBFreshness: BClaude Code +9 - 0.524score
ddd-squad-coordination
MisterIcy
How the ddd-engineer build squad coordinates — the artifact-type-to-writer routing table, using ListAgents/SendMessage to align lanes without collisions, and…
SkillBFreshness: BClaude Code +9 - 0.524score
pr-description-sync
MisterIcy
Checks whether the current branch's open GitHub PR title/description still accurately reflects its actual changes, and updates it via `gh pr edit` if it has…
SkillBFreshness: BClaude Code +9 - 0.520score
ddd-squad-charter
MisterIcy
Shared charter for the ddd-engineer pipeline's agents — the roster and each agent's role, the collaborative-vs-adversarial split and why adversaries stay…
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 9, 2026 (1 month ago)
- Last release
- Sep 9, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/MisterIcy/provenance
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from MisterIcy
- 0.529score
reconciler
MisterIcy
Reconciles a GitHub stacked pull-request chain or a numerically-suffixed branch train (e.g.
SkillBFreshness: BClaude Code - 0.529score
git-committer
MisterIcy
Discovers the current git diff, groups related changes into logically separate commits, and writes Conventional Commits-formatted messages in plain…
SkillBFreshness: BClaude Code +9 - 0.529score
git-committer-setup
MisterIcy
One-time (or refresh) setup for the git-committer skill — ingests the N most recent commits by the current git author and writes a personalized commit-message…
SkillBFreshness: BClaude Code +9 - 0.529score
phpunit
MisterIcy
PHPUnit knowledge for writing, running, debugging, and improving tests — writing tests, the CLI test runner, fixtures/setup-teardown, test organization…
SkillBFreshness: BClaude Code +9 - 0.529score
ddd-engineer
MisterIcy
Domain-Driven-Design engineering orchestrator.
SkillBFreshness: BClaude Code - 0.525score
mariadb-sql
MisterIcy
MariaDB-specific SQL dialect knowledge — correctness pitfalls (NULL/GROUP BY/collation semantics), performance (optimizer, indexes, EXPLAIN reading)…
SkillBFreshness: BClaude Code +9
Cite this page
vitest skill. Agent Mart. https://agentmart.dev/skills/mistericy-vitest (last updated 2026-10-24)