(files: Record<string, string>, include: string[])
| 133 | let handler: ToolHandler; |
| 134 | |
| 135 | const setup = async (files: Record<string, string>, include: string[]) => { |
| 136 | testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-boundary-')); |
| 137 | const src = path.join(testDir, 'src'); |
| 138 | fs.mkdirSync(src, { recursive: true }); |
| 139 | for (const [name, content] of Object.entries(files)) { |
| 140 | fs.writeFileSync(path.join(src, name), content); |
| 141 | } |
| 142 | cg = CodeGraph.initSync(testDir, { config: { include, exclude: [] } }); |
| 143 | await cg.indexAll(); |
| 144 | handler = new ToolHandler(cg); |
| 145 | }; |
| 146 | |
| 147 | afterEach(() => { |
| 148 | if (cg) cg.destroy(); |
no test coverage detected