(path: readonly { name: string; filePath?: string; observed?: ObservedRecord }[])
| 348 | * recorded. |
| 349 | */ |
| 350 | export function observedRuns(path: readonly { name: string; filePath?: string; observed?: ObservedRecord }[]): BugPathNode[][] { |
| 351 | const runs: BugPathNode[][] = []; |
| 352 | let current: BugPathNode[] = []; |
| 353 | for (let at = 1; at < path.length; at++) { |
| 354 | const step = path[at]; |
| 355 | if (step.observed === undefined) { |
| 356 | if (current.length >= 2) { |
| 357 | runs.push(current); |
| 358 | } |
| 359 | current = []; |
| 360 | continue; |
| 361 | } |
| 362 | if (current.length === 0) { |
| 363 | const previous = path[at - 1]; |
| 364 | current.push({ name: previous.name, filePath: previous.filePath }); |
| 365 | } |
| 366 | current.push({ name: step.name, filePath: step.filePath, observed: step.observed }); |
| 367 | } |
| 368 | if (current.length >= 2) { |
| 369 | runs.push(current); |
| 370 | } |
| 371 | return runs; |
| 372 | } |
| 373 | |
| 374 | /** Every observed call one flow answer reports, as ordered pairs. */ |
| 375 | export function flowObservations(flow: FlowDetail): { from: BugPathNode; to: BugPathNode; observed: ObservedRecord }[] { |
no test coverage detected