Your First Vitest Run
Running Vitest tests with Currents dashboard
Vitest doesn't have a dedicated Currents reporter. Instead, Vitest writes a JUnit XML report using its built-in junit reporter, and @currents/cmd converts and uploads it to Currents.
Prerequisites
Your First Vitest Run
Step 1: Run the tests
If you passed the reporter in the test script (Option 2), run npm test instead.
Vitest saves the JUnit XML report at the location configured by outputFile.junit - ./results.xml in the examples above.
Step 2: Convert and upload the results
Run currents run upload with --input-format junit to convert the JUnit XML report to the Currents format and send it to the Currents dashboard (see Upload JUnit XML reports). Set --framework-version to the Vitest version you're running.
Set the Record Key and Project ID obtained from Currents dashboard in the previous step.
Explore Your First Run
The execution results will show on the Currents dashboard. A link to the run is printed when the upload completes.

Good To Know
vitest run exits with a non-zero code when tests fail, which stops a CI job before the results are converted and uploaded. Run the conversion and upload steps unconditionally - see Vitest - GitHub Actions for an example.
Example
Check out the Vitest example in the JUnit XML example repository.
Last updated
Was this helpful?
