Skip to main content
TestDriver writes a JSON file for each test after it finishes.
  • It has the test’s result, error, and links to its report and replay.
  • It also records versions, sandbox details, and how many find() calls hit the cache.
  • Use it in CI scripts instead of parsing console output.

Turn it on

The TestDriver Vitest reporter writes the files. npx testdriverai init adds it to vitest.config.js for you:
vitest.config.js
The reporter records each run in TestDriver, so it needs your API key in TD_API_KEY. If it can’t record the run, it doesn’t write the files.

Where the files go

  • <test file> is the test file’s path relative to the project root, such as tests/login.test.mjs.
  • <test id> is Vitest’s ID for the test, with characters other than letters, digits, _, ., and - replaced by _. Read the test’s name from test.name inside the file.
The folder isn’t cleared between runs. Delete .testdriver/results before a run if you only want the latest results.

Example

.testdriver/results/tests/login.test.mjs/1223128da3_0_0.json
Values that TestDriver doesn’t know are null.

Fields

versions

test

urls

replay

The test’s Dashcam recording. gifUrl, embedUrl, and markdown are filled in only when the replay link includes a ?share= key.

date, team, and infrastructure

realtime and interactions

Use the results in CI

This GitHub Actions step adds a table of results to the job summary:
To read the results in Node.js:
scripts/report.mjs