What the calls and references on the line marked `// marker` in `file` reach, as `kind Owner::Name`.
(file: string, marker: string)
| 428 | |
| 429 | /** What the calls and references on the line marked `// marker` in `file` reach, as `kind Owner::Name`. */ |
| 430 | function reached(file: string, marker: string): string[] { |
| 431 | const line = FILES[file]!.split('\n').findIndex((l) => l.endsWith(`// ${marker}`)) + 1; |
| 432 | expect(line, marker).toBeGreaterThan(0); |
| 433 | const out: string[] = []; |
| 434 | for (const n of cg!.getNodesInFile(file)) { |
| 435 | for (const e of cg!.getOutgoingEdges(n.id)) { |
| 436 | if ((e.kind !== 'calls' && e.kind !== 'references') || e.line !== line) continue; |
| 437 | out.push(`${e.kind} ${cg!.getNode(e.target)!.qualifiedName}`); |
| 438 | } |
| 439 | } |
| 440 | return out.sort(); |
| 441 | } |
| 442 | |
| 443 | it('indexes a helper as a class whose signature says what it helps', () => { |
| 444 | expect(node('TRecordHelper').kind).toBe('class'); |
no test coverage detected