(name: string, data: Buffer)
| 53 | const tempDirs: string[] = [] |
| 54 | |
| 55 | const createTempFile = (name: string, data: Buffer): string => { |
| 56 | const tmpDir = fs.mkdtempSync(join(os.tmpdir(), 'nostream-compression-')) |
| 57 | tempDirs.push(tmpDir) |
| 58 | |
| 59 | const filePath = join(tmpDir, name) |
| 60 | fs.writeFileSync(filePath, data) |
| 61 | |
| 62 | return filePath |
| 63 | } |
| 64 | |
| 65 | afterEach(() => { |
| 66 | for (const tmpDir of tempDirs.splice(0)) { |