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

Jest

$ jest Foundation Low Risk
OpenJS Foundation / Meta · Code & DevOps · MIT · macos / linux / windows

jest is a full-featured JavaScript and TypeScript test runner with built-in assertions, mocking, and coverage. Native --json, --listTests --json, --ci, and --no-color give agents deterministic machine-readable results without watch-mode hangs.

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

Local Node.js test framework tightly integrated with package.json and repo files; run directly via npx jest.

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 23 / 25

First-class --json, --outputFile, --listTests --json, --ci, and --no-color flags make Jest highly predictable for headless agents.

  • --json and --listTests --json emit valid JSON
  • --ci prevents accidental snapshot updates and interactive prompts
Trust & Safety 21 / 25

Runs locally with no auth; --ci guards against silent snapshot mutations, though -u overwrites snapshot files.

  • --ci disables automatic snapshot creation/updates
Setup & Portability 13 / 15

Ubiquitous across macOS, Linux, and Windows in any Node.js project via npm or npx.

  • Standard npm/npx installation requiring Node.js
Utility & Efficiency 14 / 15

All-in-one runner, assertion library, mock system, and coverage collector with parallel worker execution.

  • Integrated test runner, mocks, snapshots, and Istanbul/V8 coverage
Maintenance & Lineage 9 / 10

Hosted by the OpenJS Foundation (originally Meta) with MIT licensing and massive ecosystem stability.

  • OpenJS Foundation Impact project
Docs & Verifiability 8 / 10

Well-documented CLI flags at jestjs.io/docs/cli and complete --help listing.

  • Comprehensive CLI option docs

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials required; executes local JavaScript/TypeScript test suites via Node.js.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source OpenJS Foundation project; free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Jest Agent Rules
- Always pass `--ci --json` (or `--no-color`) and never invoke `--watch` or `--watchAll` in agent sessions.
- Never pass `-u` / `--updateSnapshot` unless explicitly updating snapshots after user confirmation.
- Scope large monorepos by passing a path pattern or `--testPathPattern`.

Agent-Ready Command Recipes

Safe Read-Only Queries

List discovered test files as JSON
npx jest --listTests --json

Prints a JSON array of all test file paths that Jest would run without executing tests.

Run tests in CI mode with JSON output
npx jest --ci --json --no-color --passWithNoTests

Disables snapshot auto-writes and watch mode, emitting full structured test results as JSON.

Controlled Writes & Previews

Run tests and write coverage and JSON report files
npx jest --ci --coverage --json --outputFile=jest-results.json

Generates coverage/ reports and writes structured JSON test results to jest-results.json.

Strengths for Agents

  • + --json and --listTests --json give structured test discovery and per-assertion results.
  • + --ci enforces strict non-interactive behavior and disables implicit snapshot writes.
  • + Built-in --coverage and parallel test sharding.

Caveats & Pitfalls

  • ! --watch / --watchAll will hang headless agent sessions.
  • ! Without --outputFile, console.log statements from tests can mix with --json unless --silent is passed.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI