Produces JUnit-style XML test results.
$ npm install mocha-junit-reporter --save-devor as a global module
$ npm install -g mocha-junit-reporterRun mocha with mocha-junit-reporter:
$ mocha test --reporter mocha-junit-reporterThis will output a results file at ./test-results.xml.
You may optionally declare an alternate location for results XML file by setting
the command line argument MOCHA_FILE or mochaFile in reporterOptions:
$ MOCHA_FILE=./path_to_your/file.xml mocha test --reporter mocha-junit-reporteror
var mocha = new Mocha({
reporter: 'mocha-junit-reporter',
reporterOptions: {
mochaFile: './path_to_your/file.xml'
}
});