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

Function project

__tests__/store-binding-cache.test.ts:29–42  ·  view source on GitHub ↗
(active: boolean)

Source from the content-addressed store, hash-verified

27}
28
29async function project(active: boolean) {
30 const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-store-cache-'));
31 fs.writeFileSync(path.join(dir, 'store.ts'), `import { create } from 'zustand';
32export const useStore = create((set) => ({ reset: () => set({}) }));
33`);
34 fs.writeFileSync(path.join(dir, 'decoy.ts'), 'export function reset() { return 99; }');
35 fs.writeFileSync(path.join(dir, 'consumer.ts'), consumer(active));
36 const cg = CodeGraph.initSync(dir);
37 projects.push({ dir, cg });
38 const result = await cg.indexAll();
39 expect(result.success).toBe(true);
40 expect(result.filesErrored).toBe(0);
41 return { dir, cg };
42}
43
44function assertBindings(cg: CodeGraph, active: boolean) {
45 const functions = cg.getNodesByKind('function');

Callers 1

Calls 5

initSyncMethod · 0.80
pushMethod · 0.80
consumerFunction · 0.70
joinMethod · 0.45
indexAllMethod · 0.45

Tested by

no test coverage detected