(files: Record<string, string>, include: string[])
| 146 | let handler: ToolHandler; |
| 147 | |
| 148 | const setup = async (files: Record<string, string>, include: string[]) => { |
| 149 | testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-boundary-')); |
| 150 | const src = path.join(testDir, 'src'); |
| 151 | fs.mkdirSync(src, { recursive: true }); |
| 152 | for (const [name, content] of Object.entries(files)) { |
| 153 | fs.writeFileSync(path.join(src, name), content); |
| 154 | } |
| 155 | cg = CodeGraph.initSync(testDir, { config: { include, exclude: [] } }); |
| 156 | await cg.indexAll(); |
| 157 | handler = new ToolHandler(cg); |
| 158 | }; |
| 159 | |
| 160 | afterEach(() => { |
| 161 | if (cg) cg.destroy(); |
no test coverage detected