(run: (dir: string) => Promise<T> | T)
| 25 | type State = Readonly<{ value: number }>; |
| 26 | |
| 27 | async function withTempDir<T>(run: (dir: string) => Promise<T> | T): Promise<T> { |
| 28 | const dir = mkdtempSync(join(tmpdir(), "rezi-node-hsr-lifecycle-test-")); |
| 29 | try { |
| 30 | return await run(dir); |
| 31 | } finally { |
| 32 | rmSync(dir, { recursive: true, force: true }); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | function writeViewModule(root: string, label: string): string { |
| 37 | mkdirSync(root, { recursive: true }); |
no test coverage detected