()
| 31 | |
| 32 | // Signal aborted while writing file |
| 33 | async function doWriteAndCancel() { |
| 34 | const filePathForHandle = path.resolve(tmpDir, 'dogs-running.txt'); |
| 35 | const fileHandle = await open(filePathForHandle, 'w+'); |
| 36 | try { |
| 37 | const buffer = Buffer.from('dogs running'.repeat(512 * 1024), 'utf8'); |
| 38 | const controller = new AbortController(); |
| 39 | const { signal } = controller; |
| 40 | process.nextTick(() => controller.abort()); |
| 41 | await assert.rejects(writeFile(fileHandle, buffer, { signal }), { |
| 42 | name: 'AbortError' |
| 43 | }); |
| 44 | } finally { |
| 45 | await fileHandle.close(); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | const dest = path.resolve(tmpDir, 'tmp.txt'); |
| 50 | const otherDest = path.resolve(tmpDir, 'tmp-2.txt'); |
no test coverage detected
searching dependent graphs…