(filePath: string, source: string, minNodes = 3)
| 87 | }); |
| 88 | |
| 89 | function assertParity(filePath: string, source: string, minNodes = 3): void { |
| 90 | process.env.CODEGRAPH_KERNEL_LANGS = 'all'; |
| 91 | delete process.env.CODEGRAPH_KERNEL; |
| 92 | const viaKernel = tryKernelExtract(filePath, source, 'php'); |
| 93 | expect(viaKernel, `kernel extraction failed for ${filePath}`).not.toBeNull(); |
| 94 | |
| 95 | process.env.CODEGRAPH_KERNEL = '0'; |
| 96 | const viaWasm = extractFromSource(filePath, source, 'php'); |
| 97 | delete process.env.CODEGRAPH_KERNEL; |
| 98 | |
| 99 | const k = canon(viaKernel!); |
| 100 | const w = canon(viaWasm); |
| 101 | expect(k.nodes, `${filePath}: nodes`).toEqual(w.nodes); |
| 102 | expect(k.edges, `${filePath}: edges`).toEqual(w.edges); |
| 103 | expect(k.refs, `${filePath}: refs`).toEqual(w.refs); |
| 104 | expect(viaWasm.nodes.length).toBeGreaterThanOrEqual(minNodes); |
| 105 | } |
| 106 | |
| 107 | const FIXTURES: Array<{ file: string; minNodes: number }> = [ |
| 108 | { file: 'torture.php', minNodes: 45 }, |
no test coverage detected