MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / callees

Function callees

__tests__/ts-interface-extends.test.ts:428–435  ·  view source on GitHub ↗
(file: string, fn: string)

Source from the content-addressed store, hash-verified

426
427 /** `<file>:<qualified name>` of every call `fn` in `file` makes. */
428 const callees = (file: string, fn: string): string[] => {
429 const node = cg.getNodesInFile(file).find((n) => n.name === fn && n.kind === 'function')!;
430 expect(node, `${file} ${fn}`).toBeDefined();
431 return cg.getOutgoingEdges(node.id).filter((e) => e.kind === 'calls').map((e) => {
432 const target = cg.getNode(e.target)!;
433 return `${target.filePath}:${target.qualifiedName}`;
434 }).sort();
435 };
436
437 it("through a composite interface, the member of the supertype that declares it, not a namesake's", () => {
438 expect(callees('src/data/describe.ts', 'describe')).toEqual([

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected