selectReport static method
Returns the report selected by the same precedence as the CLI presenter.
Implementation
static String? selectReport(
String output, {
required bool jsonReport,
required bool junitReport,
required bool machineReport,
required bool streamLiveOutput,
}) {
final rawJson = extractJsonReport(output);
final json = jsonReport ? rawJson : '';
final junit = junitReport ? extractJunitReport(output) : '';
if (junit.isNotEmpty) return junit;
if (json.isNotEmpty) return json;
if (machineReport) return null;
final report = extractSuiteReport(
output,
includeScreenTracker: !streamLiveOutput,
);
return report.isEmpty ? null : report;
}