Jest
Jest is a testing framework for JavaScript and TypeScript.
Enabling XML Output
Configure Jest to produce JUnit XML output.
Install the jest-junit.
Update your Jest config (jest.config.json
or similar file) to add jest-junit
as a reporter.
jest.config.json
With this configuration, Jest runs with by default output a junit.xml
file in the working directory. To further configure the reporter, consult the detailed documentation on GitHub.
Test Suite Naming
The jest-junit
reporter will automatically fill in values for the and name
and class
attributes using the description parameters to the tests. The testsuites.name
is set to jest tests
by default.
For example, this test:
would produce output that looks like this:
The default attributes can be changed using jest-junit
configuration settings.
Further Configuration
Jest is highly customizable. See more at the Jestjs.io homepage.
Last updated