Vitest
Vitest is a testing framework for JavaScript.
Enabling XML Output
Configure Vitest to produce JUnit XML output using the built in junit
reporter command line option.
Typically you will do this in the package.json script that runs your tests, like this:
For more details see the Vitest reporter docs.
Test Suite Naming
The generated XML contains nested testsuites
and testcase
tags. You can use the environment variables VITEST_JUNIT_SUITE_NAME
and VITEST_JUNIT_CLASSNAME
to configure their name
and classname
attributes, respectively. These can also be customized via reporter options:
For more details see the Vitest JUnit Reporter docs.
Last updated