Test Inventory
v0.13.0Discover tests, skip reasons and affected tests, and compare inventories without running tests.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
test_summary Test summary
Counts a project's tests by state (active, skip, fixme, todo, expectedToFail, notLoaded) and by tag and annotation, from the test files, without running them. Use it first, for questions such as how many tests are skipped, or which files or tags have the most skipped tests; use find_tests to list the tests themselves. states, tags and grep count only the tests they match. groupBy "file", "tag" or "project" adds the counts of each, sorted by name and paged with limit and cursor; a test with no tag is in no tag group, and one whose projects the scan cannot tell in no project group. configs lists…
| Parameter | Type | Description |
|---|---|---|
cursor | string | nextCursor from the previous answer, for the next page. Keep the other arguments the same. |
directory | string | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. |
expandCases | boolean | Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pa… |
framework | string | The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses. |
grep | string | Keeps tests whose fullName (describe titles and title joined with " > ") matches this regular expression, ignoring case. |
groupBy | string | Adds the counts of each file, tag or project. |
limit | integer | The most items to return. |
patterns | array | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run. |
related | array | Changed files, relative to the project root as `git diff --name-only` writes them, such as ["pages/order-ticket.ts"]. Keeps tests that list a changed dependency, match a changed file through dependenc… |
states | array | Keeps tests in one of these states. |
tags | array | Keeps tests with one of these tags, written as in the titles, such as "@smoke". |
find_tests Find tests
Lists a project's tests that match filters, read from the test files without running them: each with its id, full name, file and line, state, skip reason and condition, and tags by default. Use it for questions such as which tests are skipped and why, which tests carry @smoke, where a .only was left in, or which tests a change can affect (related, the changed files); use test_summary for counts and get_tests for every key of a few ids. projects keeps the tests one of the named projects runs, after each project's grep, leaving out tests whose projects the scan cannot tell. Filters combine with…
| Parameter | Type | Description |
|---|---|---|
cursor | string | nextCursor from the previous answer, for the next page. Keep the other arguments the same. |
directory | string | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. |
expandCases | boolean | Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pa… |
fields | array | Keys of each test record to return, besides id. Default: fullName, relativeFilePath, lineStart, state, reason, condition, tags. |
framework | string | The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses. |
grep | string | Keeps tests whose fullName (describe titles and title joined with " > ") matches this regular expression, ignoring case. |
limit | integer | The most items to return. |
only | boolean | true keeps tests that use .only, or are in a describe that does. |
patterns | array | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run. |
projects | array | Keeps tests that one of these projects runs, named as in the configs test_summary lists. |
related | array | Changed files, relative to the project root as `git diff --name-only` writes them, such as ["pages/order-ticket.ts"]. Keeps tests that list a changed dependency, match a changed file through dependenc… |
states | array | Keeps tests in one of these states. |
tags | array | Keeps tests with one of these tags, written as in the titles, such as "@smoke". |
unconditional | boolean | Keeps tests whose effective state has no condition. |
withoutReason | boolean | true keeps non-active tests without a reason, including expected failures; excludes notLoaded. |
get_tests Get tests
Returns every key of the tests with the given ids, with the scan diagnostics about them, read from the test files without running them: location, describe path, state and where it is set, condition, reason, tags, annotations, comments above the test, parameters, the projects that run it, hooks around it, timeout and retries with where each is set (the test, a describe, the file or the config), fixtures, expect() counts, steps, body hash, and the files the test runs with dependencyHash. Use it after find_tests or test_summary, for the details of up to 20 tests. Ids come from find_tests and stay…
| Parameter | Type | Description |
|---|---|---|
ids * | array | Test ids, as find_tests returns them. |
directory | string | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. |
expandCases | boolean | Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pa… |
framework | string | The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses. |
patterns | array | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run. |
scan_diagnostics Scan diagnostics
Lists the problems test-inventory found while reading the test files: level error means tests may be missing from the other answers (a file that failed to parse, an import it could not follow), or that the runner fails the file or the run (a Vitest tag the config does not define, a .only that forbidOnly fails); level warning means a value is missing or approximate (a title built at run time, a config value computed at run time, a file no config runs). They are about reading the code, not test failures. Use it when another tool reports scanErrors, or to check why a test is missing or notLoaded.…
| Parameter | Type | Description |
|---|---|---|
codes | array | Keeps problems with these codes. |
cursor | string | nextCursor from the previous answer, for the next page. Keep the other arguments the same. |
directory | string | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. |
expandCases | boolean | Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pa… |
framework | string | The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses. |
levels | array | Keeps problems of these levels. |
limit | integer | The most items to return. |
path | string | Keeps problems in this file, or in the files under this folder, relative to `directory`. |
patterns | array | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run. |
diff_inventories Diff inventories
Compares two complete saved JSON scans inside the project, without running tests or changing files. Reports additions, removals, renames, moves, code and dependency changes, states, tags and other metadata. Uses ids first, then unique body hashes and file, suite or dependency context; ambiguous matches remain added and removed. Use the same framework, root, patterns, filters and expandCases for both saved scans. Hash comparisons and rename matching are disabled across tool versions. Follow nextCursor for more changes. For Playwright, Vitest, Jest, Mocha, Jasmine, Cypress, WebdriverIO, node:tes…
| Parameter | Type | Description |
|---|---|---|
after * | string | The new complete JSON inventory, relative to the project root; at most 128 MiB. |
before * | string | The old complete JSON inventory, relative to the project root; at most 128 MiB. |
cursor | string | nextCursor from the previous answer, for the next page. Keep the other arguments the same. |
limit | integer | The most items to return. |
get_run_commands Get test run commands
Returns POSIX shell commands for test files related to the changed paths. Run them from the scanned directory. Each command gives its config, projects, files and any runner caveat. A runner can run more tests than the matched declarations. The server only returns commands. Follow nextCursor for more.
| Parameter | Type | Description |
|---|---|---|
related * | array | Changed files relative to the server root, as git diff --name-only writes them. |
cursor | string | nextCursor from the previous answer, for the next page. Keep the other arguments the same. |
directory | string | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. |
expandCases | boolean | Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pa… |
framework | string | The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses. |
limit | integer | The most items to return. |
patterns | array | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run. |