extractSuiteReport function
Strips Flutter test framework noise; keeps navigation logs and the suite report.
Implementation
String extractSuiteReport(
String output, {
bool includeScreenTracker = true,
}) {
final lines = output.split('\n');
final kept = <String>[];
var inReport = false;
for (final line in lines) {
if (includeScreenTracker && line.startsWith(screenTrackerPrefix)) {
kept.add(line);
continue;
}
if (line.startsWith(suiteReportStart)) {
inReport = true;
}
if (inReport) {
kept.add(line);
if (line.startsWith('└─')) {
inReport = false;
}
}
}
if (kept.isEmpty) return '';
return '${kept.join('\n')}\n';
}