mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Configure Mocha to use the JUnit XML reporter
This commit is contained in:
@@ -7,7 +7,24 @@ import {assert} from 'chai'
|
||||
export default function (testPaths) {
|
||||
global.assert = assert
|
||||
|
||||
const mocha = new Mocha({reporter: 'spec'})
|
||||
let reporterOptions = {
|
||||
reporterEnabled: 'list'
|
||||
}
|
||||
|
||||
if (process.env.TEST_JUNIT_XML_PATH) {
|
||||
console.log(`Mocha: Producing JUnit XML output at ${process.env.TEST_JUNIT_XML_PATH}.`)
|
||||
reporterOptions = {
|
||||
reporterEnabled: 'list, mocha-junit-reporter',
|
||||
mochaJunitReporterReporterOptions: {
|
||||
mochaFile: process.env.TEST_JUNIT_XML_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const mocha = new Mocha({
|
||||
reporter: 'mocha-multi-reporters',
|
||||
reporterOptions
|
||||
})
|
||||
for (let testPath of testPaths) {
|
||||
if (fs.isDirectorySync(testPath)) {
|
||||
for (let testFilePath of fs.listTreeSync(testPath)) {
|
||||
|
||||
Reference in New Issue
Block a user