| 68 | let written = false |
| 69 | |
| 70 | const writeReport = result => { |
| 71 | if (written) return |
| 72 | if (!result || !Array.isArray(result.tests)) return |
| 73 | written = true |
| 74 | |
| 75 | const dir = config.output ? path.resolve(store.codeceptDir || process.cwd(), config.output) : store.outputDir || process.cwd() |
| 76 | mkdirp.sync(dir) |
| 77 | const file = path.join(dir, config.outputName) |
| 78 | |
| 79 | fs.writeFileSync(file, buildXml(result, config)) |
| 80 | output.plugin('junitReporter', `JUnit report saved to ${file}`) |
| 81 | } |
| 82 | |
| 83 | event.dispatcher.on(event.all.result, writeReport) |
| 84 | event.dispatcher.on(event.workers.result, writeReport) |
nothing calls this directly
no test coverage detected