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

Function syncEdit

__tests__/sync-module-config-change.test.ts:137–146  ·  view source on GitHub ↗

Index `before`, write `after` over it, sync; return the graph and what a full index of the final tree holds.

(before: Files, after: Files)

Source from the content-addressed store, hash-verified

135
136/** Index `before`, write `after` over it, sync; return the graph and what a full index of the final tree holds. */
137async function syncEdit(before: Files, after: Files): Promise<{ root: string; graph: CodeGraph; full: string[] }> {
138 const root = tempRoot();
139 write(root, before);
140 const graph = await index(root);
141 write(root, after);
142 await graph.sync();
143 const fullRoot = tempRoot();
144 write(fullRoot, { ...before, ...after });
145 return { root, graph, full: stateOf(fullRoot, await index(fullRoot)) };
146}
147
148describe('a sync follows a module-config change (#2977)', () => {
149 it('tsconfig paths retargeted, the importer untouched', async () => {

Calls 5

tempRootFunction · 0.70
writeFunction · 0.70
indexFunction · 0.70
stateOfFunction · 0.70
syncMethod · 0.45

Tested by

no test coverage detected