MCPcopy
hub / github.com/qawolf/cli / createJUnitReporter

Function createJUnitReporter

src/shell/reporter/createJUnitReporter.ts:30–54  ·  view source on GitHub ↗
(deps: JUnitReporterDeps)

Source from the content-addressed store, hash-verified

28};
29
30export function createJUnitReporter(deps: JUnitReporterDeps): Reporter {
31 const flows: JUnitFlowRecord[] = [];
32
33 return {
34 onFlowPass({ name, path, durationMs }) {
35 flows.push({ name, path, status: "pass", durationMs });
36 },
37
38 onFlowFail({ name, path, err, durationMs }) {
39 flows.push({
40 name,
41 path,
42 status: "fail",
43 durationMs,
44 error: formatErrorWithCause(err),
45 });
46 },
47
48 onRunComplete({ summary }) {
49 const xml = generateJUnit(flows, summary.durationMs);
50 deps.writeFile(deps.outputPath, xml);
51 deps.stderr.write(`JUnit report saved to ${deps.outputPath}\n`);
52 },
53 };
54}

Callers 2

buildRunReporterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected