(fnName: string, kind: string = 'function')
| 554 | } |
| 555 | |
| 556 | function callersOf(fnName: string, kind: string = 'function'): string[] { |
| 557 | const results = cg.searchNodes(fnName); |
| 558 | const def = results.map((r) => r.node).find((n) => n.kind === kind && n.name === fnName); |
| 559 | if (!def) return []; |
| 560 | return cg.getCallers(def.id).map((c) => c.node.name); |
| 561 | } |
| 562 | |
| 563 | beforeEach(async () => { |
| 564 | testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-1240-')); |
no test coverage detected