Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Vitest

$ vitest Community Low Risk
VoidZero / Vitest Contributors · Code & DevOps · MIT · macos / linux / windows

Fast unit and component test framework sharing Vite's configuration and transform pipeline. Coding agents must pass vitest run (to avoid interactive watch mode) and can capture clean machine-readable results via --reporter=json.

FCRS-1.0 Score
88 /100
Good
Medium Confidence
Zero-Friction Install
npm install -D vitest
CLI vs MCP Decision CLI Only

Executes local Vite-transformed unit tests directly inside the repository.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Native --reporter=json, vitest list --json, --run, and NO_COLOR=1, though bare vitest defaults to interactive watch mode outside CI.

  • vitest run --reporter=json outputs structured test JSON
  • Bare vitest enters watch mode unless run or CI=true is set
Trust & Safety 22 / 25

Local test runner; never updates snapshots unless -u (--update) is explicitly passed.

  • Snapshots are verified read-only unless -u is passed
Setup & Portability 13 / 15

Standard npm devDependency running across macOS, Linux, and Windows with Node.js.

  • Cross-platform Node.js CLI
Utility & Efficiency 14 / 15

Fast TypeScript/ESM execution with Vite transforms and granular file/test-name filtering (-t).

  • Instant HMR-style module graph and -t test filtering
Maintenance & Lineage 9 / 10

Actively maintained MIT project led by the VoidZero / Vite ecosystem team.

  • Active vitest-dev/vitest repository
Docs & Verifiability 9 / 10

Clear CLI guide at vitest.dev/guide/cli and comprehensive flag help.

  • Official CLI reference at vitest.dev/guide/cli

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials stored or required; runs locally against workspace test files.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source npm package; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Vitest (vitest) Agent Rules
- ALWAYS pass `vitest run` (never bare `vitest`) so the runner exits instead of hanging in watch mode.
- Use `--reporter=json` (or `--reporter=dot`) and `NO_COLOR=1` for concise output.

Agent-Ready Command Recipes

Safe Read-Only Queries

List matching test files without running them
npx vitest list --json

Enumerates discovered test files and names in JSON without executing test suites.

Controlled Writes & Previews

Run tests once with JSON reporter
NO_COLOR=1 npx vitest run --reporter=json

Runs all tests once (avoiding watch mode) and outputs structured JSON test results.

Strengths for Agents

  • + vitest run --reporter=json and vitest list --json give agents exact JSON test results.
  • + Reuses vite.config.* transforms with zero extra Babel/ts-jest boilerplate.
  • + Fast worker pool and -t / filename filtering.

Caveats & Pitfalls

  • ! Running vitest without run (or CI=true) launches an interactive watch loop that hangs non-TTY agents.
  • ! Does not run tsc type-checking during normal vitest run unless --typecheck is configured.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI