What `fn` references or calls, as ` : `, sorted.
(graph: CodeGraph, fn: string)
| 35 | |
| 36 | /** What `fn` references or calls, as `<kind> <file>:<qualified name>`, sorted. */ |
| 37 | function outOf(graph: CodeGraph, fn: string): string[] { |
| 38 | const node = graph.getNodesByName(fn).find((n) => n.kind === 'function' || n.kind === 'method'); |
| 39 | expect(node, fn).toBeDefined(); |
| 40 | return graph.getOutgoingEdges(node!.id) |
| 41 | .filter((e) => e.kind === 'references' || e.kind === 'calls') |
| 42 | .map((e) => { const t = graph.getNode(e.target)!; return `${e.kind} ${t.filePath}:${t.qualifiedName}`; }) |
| 43 | .sort(); |
| 44 | } |
| 45 | |
| 46 | const GRAPH = 'pub struct Graph { n: u32 }\n\nimpl Graph {\n pub fn counts(&self) -> u32 { self.n }\n}\n'; |
| 47 |
no test coverage detected