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

Function editAndCompare

__tests__/python-module-resolution.test.ts:1260–1268  ·  view source on GitHub ↗
(initial: Record<string, string>, edit: Record<string, string>, expected: string)

Source from the content-addressed store, hash-verified

1258 const IMPL = 'class N:\n def run(self):\n return 1\n';
1259
1260 async function editAndCompare(initial: Record<string, string>, edit: Record<string, string>, expected: string) {
1261 write(initial);
1262 cg = await CodeGraph.init(tempDir, { index: true });
1263 write(edit);
1264 await cg.sync();
1265 const fresh = await freshEdges();
1266 expect(fresh).toContain(expected);
1267 expect(pythonEdges(cg)).toEqual(fresh);
1268 }
1269
1270 it('adding a def of N moves the import off the submodule (E1)', () =>
1271 editAndCompare(

Calls 5

freshEdgesFunction · 0.85
pythonEdgesFunction · 0.85
writeFunction · 0.70
initMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected