Every node, edge and parked reference of an index, by natural key.
(cg: CodeGraph)
| 582 | describe('a sync gives what a fresh index gives', () => { |
| 583 | /** Every node, edge and parked reference of an index, by natural key. */ |
| 584 | function graphOf(cg: CodeGraph): { edges: string[] } { |
| 585 | const keys = new Map( |
| 586 | cg.getFiles() |
| 587 | .flatMap((file) => cg.getNodesInFile(file.path)) |
| 588 | .map((n) => [n.id, `${n.kind} ${n.filePath}:${n.qualifiedName}:${n.startLine}`] as const), |
| 589 | ); |
| 590 | const edges = cg.getOutgoingEdgesFrom([...keys.keys()]).map((e) => |
| 591 | `${e.kind} ${keys.get(e.source)} -> ${keys.get(e.target) ?? e.target} @${e.line}:${e.column} ${JSON.stringify(e.metadata ?? {})}`); |
| 592 | return { edges: edges.sort() }; |
| 593 | } |
| 594 | |
| 595 | const FRESH_TIMEOUT = 60_000; |
| 596 |
no test coverage detected