Jest
$ jest Foundation Low Riskjest 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.
npm install -D jest Local Node.js test framework tightly integrated with package.json and repo files; run directly via npx jest.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
First-class --json, --outputFile, --listTests --json, --ci, and --no-color flags make Jest highly predictable for headless agents.
--jsonand--listTests --jsonemit valid JSON--ciprevents accidental snapshot updates and interactive prompts
Runs locally with no auth; --ci guards against silent snapshot mutations, though -u overwrites snapshot files.
--cidisables automatic snapshot creation/updates
Ubiquitous across macOS, Linux, and Windows in any Node.js project via npm or npx.
- Standard
npm/npxinstallation requiring Node.js
All-in-one runner, assertion library, mock system, and coverage collector with parallel worker execution.
- Integrated test runner, mocks, snapshots, and Istanbul/V8 coverage
Hosted by the OpenJS Foundation (originally Meta) with MIT licensing and massive ecosystem stability.
- OpenJS Foundation Impact project
Well-documented CLI flags at jestjs.io/docs/cli and complete --help listing.
- Comprehensive CLI option docs
Security, Auth & Guardrails
No credentials required; executes local JavaScript/TypeScript test suites via Node.js.
MIT open-source OpenJS Foundation project; free.
# 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
npx jest --listTests --json
Prints a JSON array of all test file paths that Jest would run without executing tests.
npx jest --ci --json --no-color --passWithNoTests
Disables snapshot auto-writes and watch mode, emitting full structured test results as JSON.
Controlled Writes & Previews
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
- +
--jsonand--listTests --jsongive structured test discovery and per-assertion results. - +
--cienforces strict non-interactive behavior and disables implicit snapshot writes. - + Built-in
--coverageand parallel test sharding.
Caveats & Pitfalls
- !
--watch/--watchAllwill hang headless agent sessions. - ! Without
--outputFile,console.logstatements from tests can mix with--jsonunless--silentis passed.