(stdout: string)
| 282 | }; |
| 283 | |
| 284 | const sortTests = (stdout: string) => |
| 285 | stdout |
| 286 | .split('\n') |
| 287 | .reduce<Array<Array<string>>>((tests, line) => { |
| 288 | if (['RUNS', 'PASS', 'FAIL'].includes(line.slice(0, 4))) { |
| 289 | tests.push([line]); |
| 290 | } else { |
| 291 | tests.at(-1)!.push(line); |
| 292 | } |
| 293 | return tests; |
| 294 | }, []) |
| 295 | .sort(([a], [b]) => (a > b ? 1 : -1)) |
| 296 | .map(strings => |
| 297 | strings.length > 1 ? `${strings.join('\n').trimEnd()}\n` : strings[0], |
| 298 | ) |
| 299 | .join('\n') |
| 300 | .trim(); |
| 301 | |
| 302 | export const extractSortedSummary = (stdout: string) => { |
| 303 | const {rest, summary} = extractSummary(stdout); |
no test coverage detected