(filePath: string, source: string, minNodes = 2)
| 84 | }); |
| 85 | |
| 86 | function assertParity(filePath: string, source: string, minNodes = 2): ExtractionResult { |
| 87 | process.env.CODEGRAPH_KERNEL_LANGS = 'all'; |
| 88 | delete process.env.CODEGRAPH_KERNEL; |
| 89 | const viaKernel = tryKernelExtract(filePath, source, 'dart'); |
| 90 | expect(viaKernel, `kernel extraction failed for ${filePath}`).not.toBeNull(); |
| 91 | |
| 92 | process.env.CODEGRAPH_KERNEL = '0'; |
| 93 | const viaWasm = extractFromSource(filePath, source, 'dart'); |
| 94 | delete process.env.CODEGRAPH_KERNEL; |
| 95 | |
| 96 | const k = canon(viaKernel!); |
| 97 | const w = canon(viaWasm); |
| 98 | expect(k.nodes, `${filePath}: nodes`).toEqual(w.nodes); |
| 99 | expect(k.edges, `${filePath}: edges`).toEqual(w.edges); |
| 100 | expect(k.refs, `${filePath}: refs`).toEqual(w.refs); |
| 101 | expect(viaWasm.nodes.length).toBeGreaterThanOrEqual(minNodes); |
| 102 | return viaKernel!; |
| 103 | } |
| 104 | |
| 105 | const FIXTURES = [ |
| 106 | ['torture.dart', 30], |
no test coverage detected