The `calls` edges out of a function or method named `caller`, as `name@file`.
(caller: string)
| 37 | |
| 38 | /** The `calls` edges out of a function or method named `caller`, as `name@file`. */ |
| 39 | function callees(caller: string): string[] { |
| 40 | const from = [...cg!.getNodesByKind('function'), ...cg!.getNodesByKind('method')].filter((n) => n.name === caller); |
| 41 | expect(from.length, `${caller} should be indexed`).toBeGreaterThan(0); |
| 42 | return from |
| 43 | .flatMap((n) => cg!.getOutgoingEdges(n.id)) |
| 44 | .filter((e) => e.kind === 'calls') |
| 45 | .map((e) => cg!.getNode(e.target)) |
| 46 | .filter((n): n is NonNullable<typeof n> => !!n) |
| 47 | .map((n) => `${n.qualifiedName}@${n.filePath}`) |
| 48 | .sort(); |
| 49 | } |
| 50 | |
| 51 | describe('a Python call on self or cls (#2958)', () => { |
| 52 | it("the issue's repro: an attribute set from a parameter is not another file's function", async () => { |
no test coverage detected