Mocha
Mocha is a testing framework for JavaScript and TypeScript.
Enabling XML Output
Mocha can be configured to produce JUnit XML output by adding the mocha-junit-reporter
package to your codebase.
Now run Mocha from the command line or inside your CI system as:
Test Suite Naming
The mocha-junit-reporter
will automatically fill in values for the <testcase/>
and <testsuite/>
name
and class
attributes. The test:
will produce output that looks like this:
The default attributes can be configured with the reporterOptions
argument in the .mocharc.js
or similar config file.
By default Mocha will include the file
attribute.
Further Information
See an example of MochaJS invoked form a GitHub action here.
Last updated