(g: CodeGraph)
| 785 | let cg: CodeGraph; |
| 786 | |
| 787 | const snapshot = (g: CodeGraph): string => { |
| 788 | // Natural-key snapshot of the whole graph, mirroring dump-graph.mjs at |
| 789 | // unit scale: scoped and full sync must land the DB in the same state. |
| 790 | const nodes = g |
| 791 | .searchNodes('', { limit: 100000 }) |
| 792 | .map((r) => r.node) |
| 793 | .map((n) => `${n.kind}|${n.qualifiedName}|${n.filePath}|${n.startLine}`) |
| 794 | .sort() |
| 795 | .join('\n'); |
| 796 | return nodes; |
| 797 | }; |
| 798 | |
| 799 | beforeEach(async () => { |
| 800 | testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-sync-scoped-')); |
no test coverage detected