function buildXML
buildXML(cases: JUnitCase[]): string

Builds the full JUnit XML document string from a flat list of test cases.

const xml = buildXML([{ classname: 'Math', name: 'adds', time: 0.002, status: 'passed' }]);
xml.includes('<testsuite name="Math" tests="1" failures="0" skipped="0" time="0.002">'); // true
xml.includes('<testcase name="adds" classname="Math" time="0.002"/>'); // true — self-closing

Parameters

cases: JUnitCase[]

Return Type

string

Usage

import { buildXML } from "lib/reporters/junit.ts";