()
| 195 | doAsyncIterReturnTest().then(common.mustCall()); |
| 196 | |
| 197 | async function doAsyncIterThrowTest() { |
| 198 | const dir = await fs.promises.opendir(testDir); |
| 199 | try { |
| 200 | for await (const dirent of dir) { // eslint-disable-line no-unused-vars |
| 201 | throw new Error('oh no'); |
| 202 | } |
| 203 | } catch (err) { |
| 204 | if (err.message !== 'oh no') { |
| 205 | throw err; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | await assert.rejects(dir.read(), dirclosedError); |
| 210 | } |
| 211 | doAsyncIterThrowTest().then(common.mustCall()); |
| 212 | |
| 213 | // Check error thrown on invalid values of bufferSize |
no test coverage detected
searching dependent graphs…