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

Function syncEdit

__tests__/sync-module-config-change.test.ts:163–172  ·  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

161
162/** Index `before`, write `after` over it, sync; return the graph and what a full index of the final tree holds. */
163async function syncEdit(before: Files, after: Files): Promise<{ root: string; graph: CodeGraph; full: string[] }> {
164 const root = tempRoot();
165 write(root, before);
166 const graph = await index(root);
167 write(root, after);
168 await graph.sync();
169 const fullRoot = tempRoot();
170 write(fullRoot, { ...before, ...after });
171 return { root, graph, full: stateOf(fullRoot, await index(fullRoot)) };
172}
173
174describe('a sync follows a module-config change (#2977)', () => {
175 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