(name: string, content: string, run: (filePath: string) => void)
| 29 | } |
| 30 | |
| 31 | function withTempFile(name: string, content: string, run: (filePath: string) => void): void { |
| 32 | const dir = makeTempDir(); |
| 33 | const filePath = path.join(dir, name); |
| 34 | fs.writeFileSync(filePath, content, 'utf-8'); |
| 35 | run(filePath); |
| 36 | } |
| 37 | |
| 38 | /** Write a temp file and return its path (for async tests that can't use the callback form). */ |
| 39 | function makeTempFile(name: string, content: string): string { |
no test coverage detected