MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / snapshot

Function snapshot

__tests__/sync.test.ts:765–775  ·  view source on GitHub ↗
(g: CodeGraph)

Source from the content-addressed store, hash-verified

763 let cg: CodeGraph;
764
765 const snapshot = (g: CodeGraph): string => {
766 // Natural-key snapshot of the whole graph, mirroring dump-graph.mjs at
767 // unit scale: scoped and full sync must land the DB in the same state.
768 const nodes = g
769 .searchNodes('', { limit: 100000 })
770 .map((r) => r.node)
771 .map((n) => `${n.kind}|${n.qualifiedName}|${n.filePath}|${n.startLine}`)
772 .sort()
773 .join('\n');
774 return nodes;
775 };
776
777 beforeEach(async () => {
778 testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-sync-scoped-'));

Callers 1

sync.test.tsFile · 0.85

Calls 2

joinMethod · 0.45
searchNodesMethod · 0.45

Tested by

no test coverage detected