(fn: (dir: string) => void)
| 237 | |
| 238 | describe("applyResolutionPreset", () => { |
| 239 | function withFixture(fn: (dir: string) => void): void { |
| 240 | const dir = mkdtempSync(join(tmpdir(), "hf-resolution-test-")); |
| 241 | try { |
| 242 | mkdirSync(dir, { recursive: true }); |
| 243 | fn(dir); |
| 244 | } finally { |
| 245 | rmSync(dir, { recursive: true, force: true }); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | const sampleHtml = [ |
| 250 | "<!doctype html>", |