Skip to content

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:

sh
npx test-inventory --state skip --state fixme --fields fullName,state,condition,reason --pretty

Or print the runner command for tests affected by files changed on your branch:

sh
git diff --name-only origin/main... | npx test-inventory --related - --format commands

npx 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:

sh
npm install --save-dev test-inventory

Save a full inventory ​

To save the full inventory to disk for querying, diffing or CI checks:

sh
npx test-inventory --pretty --output inventory.json

You can also pass quoted globs and --framework to pick files explicitly. For example, a Playwright project with specs in tests/:

sh
npx test-inventory "tests/**/*.spec.ts" --framework playwright --output inventory.json

The 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:

sh
node -e "const i = require('./inventory.json'); console.log(i.summary); console.log(i.diagnostics)"

Before acting on the numbers:

  • Check diagnostics even 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. expectedToFail tests still run.
  • Loops and tables count as one record by default: pass --expand-cases to 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):

Next ​

Documentation for test-inventory 0.12.2. Released under the MIT License.