Getting started
test-inventory reads JavaScript and TypeScript test files and configs from source without running the suite. You need Node.js 22.12 or newer (Linux, macOS or Windows, x64 or Arm) and an existing test suite.
Looking for another entry point? Use the GitHub Action for automatic pull request comments or the MCP server for AI coding clients.
Try it without installing
From your project folder (where package.json lives), list tests marked skip or fixme with their conditions and reasons:
npx test-inventory --state skip --state fixme --fields fullName,state,condition,reason --prettyOr print the runner command for tests affected by files changed on your branch:
git diff --name-only origin/main... | npx test-inventory --related - --format commandsnpx may ask to download the package on first run. The scanner detects your runner and reads its config automatically. If your project uses several runners, add --framework <name>.
Choose your framework
For runner-specific commands, examples, syntax and limits, jump straight to your runner's guide:
Playwright · Vitest · Jest · Mocha · Jasmine · Cypress · WebdriverIO · node:test · Bun
All framework guides also covers mixed-runner repositories.
Install
Add test-inventory as a dev dependency when you want reproducible scans in CI, package scripts or Node.js code:
npm install --save-dev test-inventorySave a full inventory
To save the full inventory to disk for querying, diffing or CI checks:
npx test-inventory --pretty --output inventory.jsonYou can also pass quoted globs and --framework to pick files explicitly. For example, a Playwright project with specs in tests/:
npx test-inventory "tests/**/*.spec.ts" --framework playwright --output inventory.jsonThe scan replaces inventory.json once the new output is complete. It never runs your tests or changes source files.
Check the result
Print the summary counts and any diagnostics from the saved file:
node -e "const i = require('./inventory.json'); console.log(i.summary); console.log(i.diagnostics)"Before acting on the numbers:
- Check
diagnosticseven when the command exits with 0: errors mean files failed to parse, imports could not be followed, or config settings were unreadable, so tests may be missing. Use troubleshooting if counts look empty or unexpected. - Declarations are not execution results: a conditional skip keeps its condition as source text and does not prove a run skipped the test.
expectedToFailtests still run. - Loops and tables count as one record by default: pass
--expand-casesto list each known case separately. Read key concepts and shared limits before gating CI on a scan.
Supported runners
Minimum supported versions (see checked in CI for the exact versions compared against real runners on every pull request):
- Playwright: Playwright 1.31 or newer (includes Gherkin features with playwright-bdd).
- Vitest: Vitest 1.0 or newer.
- Jest: Jest 27.0 or newer.
- Mocha: Mocha 10.0 or newer.
- Jasmine: Jasmine 3.0 or newer.
- Cypress: Cypress 10.0 or newer.
- WebdriverIO: WebdriverIO 7.0 or newer, with Mocha or Jasmine.
- node:test: node:test 22.0 or newer, using the Node.js version.
- Bun: Bun 1.2.23 or newer.
Next
- One task, three interfaces: run the same query through the CLI, a library script and MCP.
- Query recipes and CI recipes (including the GitHub Action).
- Compare inventories: diff saved scans across commits or pull requests.
- AI agents: connect
test-inventory-mcpto Claude Code, Cursor or VS Code. - Examples across all 9 runners, command line reference, output reference and diagnostics.