()
| 186 | // ============================================================================= |
| 187 | |
| 188 | async function testAutoClose() { |
| 189 | const filePath = path.join(tmpDir, 'pullsync-autoclose.txt'); |
| 190 | fs.writeFileSync(filePath, 'auto close test'); |
| 191 | |
| 192 | const fh = await open(filePath, 'r'); |
| 193 | const data = textSync(fh.pullSync({ autoClose: true })); |
| 194 | assert.strictEqual(data, 'auto close test'); |
| 195 | |
| 196 | // Handle should be closed |
| 197 | await assert.rejects(fh.stat(), { code: 'EBADF' }); |
| 198 | } |
| 199 | |
| 200 | // ============================================================================= |
| 201 | // autoClose: true with early break |
no test coverage detected