(files: Record<string, string>)
| 64 | }); |
| 65 | |
| 66 | async function project(files: Record<string, string>): Promise<{ cg: CodeGraph; root: string }> { |
| 67 | await loadAllGrammars(); |
| 68 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-steps-replies-')); |
| 69 | projects.push(root); |
| 70 | for (const [rel, content] of Object.entries(files)) { |
| 71 | fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); |
| 72 | fs.writeFileSync(path.join(root, rel), content); |
| 73 | } |
| 74 | return { cg: await CodeGraph.init(root, { index: true }), root }; |
| 75 | } |
| 76 | |
| 77 | /** Each reply the route's picture draws, as `status · text · when`. */ |
| 78 | async function replies(cg: CodeGraph, root: string, routeName: string): Promise<string[]> { |
no test coverage detected