MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / writeReport

Function writeReport

lib/plugin/junitReporter.js:70–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

buildXmlFunction · 0.85

Tested by

no test coverage detected