(files: Record<string, string>)
| 59 | const projects: Array<{ root: string; cg: CodeGraph }> = []; |
| 60 | |
| 61 | async function indexProject(files: Record<string, string>): Promise<CodeGraph> { |
| 62 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-go-nested-mod-')); |
| 63 | for (const [rel, content] of Object.entries(files)) { |
| 64 | fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); |
| 65 | fs.writeFileSync(path.join(root, rel), content); |
| 66 | } |
| 67 | const cg = await CodeGraph.init(root, { index: true }); |
| 68 | projects.push({ root, cg }); |
| 69 | return cg; |
| 70 | } |
| 71 | |
| 72 | afterAll(() => { |
| 73 | for (const { root, cg } of projects) { |
no test coverage detected