(consumer: string, name: string)
| 6500 | // same question as the functions: a type annotation is a reference, not |
| 6501 | // a call. |
| 6502 | const reachedFrom = (consumer: string, name: string): boolean => { |
| 6503 | const target = cg |
| 6504 | .searchNodes(name, { limit: 10 }) |
| 6505 | .find((r) => r.node.name === name && r.node.filePath !== consumer); |
| 6506 | expect(target, `no node named ${name}`).toBeDefined(); |
| 6507 | return cg |
| 6508 | .getIncomingEdges(target!.node.id) |
| 6509 | .some((e) => cg.getNode(e.source)?.filePath === consumer); |
| 6510 | }; |
| 6511 | |
| 6512 | expect(reachedFrom('consumer.js', 'widget')).toBe(false); |
| 6513 | expect(reachedFrom('consumer.js', 'gadget')).toBe(true); |
no test coverage detected