Skip to content

Compared with the runners ​

Playwright and Vitest can list their tests too: playwright test --list --reporter=json and vitest list --json. Both load the test files, and so run the code at the top level of every file. test-inventory reads the files without running them.

test-inventoryplaywright test --listvitest list
Runs code from the test filesNoYes, top level and describesYes, or parses them in Vitest 5
Needs the runner installedNoYesYes
Loops and .each tablesOne record, with the number of casesOne test per iterationOne test per case
Skipped and todo testsListed, with the stateListedLeft out
Skip conditionsKept as source textEvaluated at load timeNot shown
TagsAs written, @smokeWithout the @, smokeNot shown
Stable id and body hashYesNoNo
One schema for both frameworksYesNoNo

Matching records with the runners' lists ​

To match a record with a runner's entry, use the file and the line range: the entry's line falls between lineStart and lineEnd. Columns differ: Playwright reports the column of the call's last name, fail in test.fail(, or of its opening parenthesis, while test-inventory and Vitest report the column where the call starts.

Vitest 5's static list ​

vitest list in Vitest 5 parses the files instead of running them, unless --no-static-parse is given. Its results differ from what the runner does: it treats any .only as applying to the whole run, lets the last modifier in a chain win, and treats runIf(true) and skipIf(false) as skipped. test-inventory follows what the runner does.

Checked in CI ​

On every pull request, CI scans the fixture projects in the repository and compares the inventory with Playwright 1.42, 1.63 and 1.64 and Vitest 3.0 and 5.0. Playwright lists the tests with --list; Vitest runs them with its JSON reporter, which, unlike vitest list, includes skipped and todo tests. Each test is matched by file and line, and its full title, its state and its tags are compared. A state set by a condition is left out, since the runner decides it on the machine it runs on. Any difference fails the check.