(file: string, name: string, kind = 'calls')
| 240 | |
| 241 | /** `<file>:<qualified name>` of every call (or edge of `kind`) the named symbol in `file` makes. */ |
| 242 | const callsFrom = (file: string, name: string, kind = 'calls'): string[] => { |
| 243 | const node = ts.getNodesInFile(file).find((n) => n.name === name && n.kind !== 'file')!; |
| 244 | expect(node, `${file} ${name}`).toBeDefined(); |
| 245 | return ts.getOutgoingEdges(node.id).filter((e) => e.kind === kind).map((e) => { |
| 246 | const target = ts.getNode(e.target)!; |
| 247 | return `${target.filePath}:${target.qualifiedName}`; |
| 248 | }); |
| 249 | }; |
| 250 | |
| 251 | it('a parameter typed as a function, or defaulted to one, calls what it is given', () => { |
| 252 | expect(callsFrom('src/use.ts', 'pick')).toEqual([]); |
no test coverage detected