jasmine-xml-reporter v1.2.1
Jasmine XML Reporter
This module adds the --junitreport and --output command-line params to Jasmine 2 npm module (jasmine).
Jasmine 2 npm module lost 2 features when compared with jasmine-node (no more maintained):
- ability to provide results in JUnit XML format (using the
--junitreportparam); - an option to specify an output dir while running from the command line (
--outputparam).
This module uses jasmine-reporters module to generate the JUnit XML report (when --junitreport param is present) and, optionally, place the generated files at folder specified by --output param.
Install
Simple as any node module:
npm install jasmine-xml-reporterUsage
To run tests with command line output only (default behavior, same as use jasmine directly):
./node_modules/jasmine-xml-reporter/bin/jasmine.jsTo run tests and generate a JUnit XML report:
./node_modules/jasmine-xml-reporter/bin/jasmine.js --junitreportTo run tests, generate a JUnit XML report and place the output in a specific folder:
./node_modules/jasmine-xml-reporter/bin/jasmine.js --junitreport --output=shippable/testresults/Additionally you can specify the output file prefix name (default output file is results.xml, so you can change the results prefix):
./node_modules/jasmine-xml-reporter/bin/jasmine.js --junitreport --output=shippable/testresults/ --filePrefix=myTestResultsIf npm test is already an alias to ./node_modules/jasmine-xml-reporter/bin/jasmine.js, then run with:
npm test -- --junitreport --output=shippable/testresults/