(indexHtml: string, subComps?: Record<string, string>)
| 20 | let dirs: string[] = []; |
| 21 | |
| 22 | function makeProject(indexHtml: string, subComps?: Record<string, string>): string { |
| 23 | const dir = tmpProject("lint"); |
| 24 | dirs.push(dir); |
| 25 | writeFileSync(join(dir, "index.html"), indexHtml); |
| 26 | if (subComps) { |
| 27 | const compsDir = join(dir, "compositions"); |
| 28 | mkdirSync(compsDir, { recursive: true }); |
| 29 | for (const [name, html] of Object.entries(subComps)) { |
| 30 | writeFileSync(join(compsDir, name), html); |
| 31 | } |
| 32 | } |
| 33 | return dir; |
| 34 | } |
| 35 | |
| 36 | afterEach(() => { |
| 37 | for (const d of dirs) { |
no test coverage detected