Jasmine
Jasmine is a testing framework for Javascript and Typescript.
Enabling XML Output
Configure Jasmine to produce JUnit XML output.
Install the jasmine-reporters
package
Create an instance of a JUnitXMLReporter to the top of your test file and add it to your Jasmine environment.
With this configuration, Jasmine will output an xml file in the tests/jasmine/reports
directory.
Test Suite Naming
Jasmine will use the test suite names for the file name and xml attributes by combining them with the JUnitXmlReporter
settings. For example with the savePath
set to "tests/jasmine/reports"
the test suite named "HuntingSeason"
will output to the file "tests/jasmine/reports/junitresults-HuntingSeason.xml".
The names of the test suites can be modified by providing a modifySuiteName()
function. See the official docs for details.
Unfortunately this reporter does not support adding the file
attribute to the XML.
Further Information
See an example of running Jasmine inside of a GitHub action here.
Last updated