(name: string)
| 7312 | |
| 7313 | /** The files of everything that calls or references the named function. */ |
| 7314 | const dependents = async (name: string): Promise<string[]> => { |
| 7315 | cg = CodeGraph.initSync(tempDir); |
| 7316 | await cg.indexAll(); |
| 7317 | const target = cg.getNodesByKind('function').find((n) => n.name === name); |
| 7318 | expect(target, name).toBeDefined(); |
| 7319 | return [...cg.getImpactRadius(target!.id, 1).nodes.values()].map((n) => n.filePath ?? '').filter((p) => !p.endsWith('.js') && !p.endsWith('.ts')); |
| 7320 | }; |
| 7321 | |
| 7322 | it('links what a view\'s inline script calls to the JavaScript that defines it', async () => { |
| 7323 | fs.writeFileSync(path.join(tempDir, 'site.js'), 'export function showToast(msg) { return msg; }\n'); |
no test coverage detected