(indexHtml: string, subComps?: Record<string, string>)
| 38 | let dirs: string[] = []; |
| 39 | |
| 40 | function makeProject(indexHtml: string, subComps?: Record<string, string>): string { |
| 41 | const dir = tmpProject("lint"); |
| 42 | dirs.push(dir); |
| 43 | writeFileSync(join(dir, "index.html"), indexHtml); |
| 44 | if (subComps) { |
| 45 | const compsDir = join(dir, "compositions"); |
| 46 | mkdirSync(compsDir, { recursive: true }); |
| 47 | for (const [name, html] of Object.entries(subComps)) { |
| 48 | writeFileSync(join(compsDir, name), html); |
| 49 | } |
| 50 | } |
| 51 | return dir; |
| 52 | } |
| 53 | |
| 54 | afterEach(() => { |
| 55 | for (const d of dirs) { |
no test coverage detected