(kind: 'function' | 'method', name: string)
| 37 | }); |
| 38 | |
| 39 | const callsFrom = (kind: 'function' | 'method', name: string) => { |
| 40 | const src = cg!.getNodesByKind(kind).find((n) => n.name === name); |
| 41 | expect(src).toBeDefined(); |
| 42 | return cg! |
| 43 | .getOutgoingEdges(src!.id) |
| 44 | .filter((e) => e.kind === 'calls') |
| 45 | .map((e) => cg!.getNode(e.target)!) |
| 46 | .map((n) => `${n.kind}:${n.name}@${n.filePath.replace(/\\/g, '/')}`); |
| 47 | }; |
| 48 | |
| 49 | it('does not bind a self-attribute chain to an unrelated same-named method', async () => { |
| 50 | fs.writeFileSync( |
no test coverage detected