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

Function makeProject

__tests__/mcp-projectpath-lifecycle.test.ts:36–42  ·  view source on GitHub ↗
(dir: string, symbol: string)

Source from the content-addressed store, hash-verified

34}
35
36async function makeProject(dir: string, symbol: string): Promise<void> {
37 fs.mkdirSync(path.join(dir, 'src'), { recursive: true });
38 fs.writeFileSync(path.join(dir, 'src', 'sample.ts'), `export function ${symbol}() { return 1; }\n`);
39 const cg = await CodeGraph.init(dir, { config: { include: ['**/*.ts'], exclude: [] } });
40 await cg.indexAll();
41 cg.close();
42}
43
44async function waitFor(check: () => Promise<boolean>, timeoutMs: number): Promise<boolean> {
45 const deadline = Date.now() + timeoutMs;

Calls 4

closeMethod · 0.65
joinMethod · 0.45
initMethod · 0.45
indexAllMethod · 0.45

Tested by

no test coverage detected