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

Function snapshot

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

Source from the content-addressed store, hash-verified

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-'));

Callers 1

sync.test.tsFile · 0.70

Calls 2

joinMethod · 0.45
searchNodesMethod · 0.45

Tested by

no test coverage detected