MCPcopy Index your code
hub / github.com/nodejs/node / doAsyncIterThrowTest

Function doAsyncIterThrowTest

test/parallel/test-fs-opendir.js:197–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195doAsyncIterReturnTest().then(common.mustCall());
196
197async 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}
211doAsyncIterThrowTest().then(common.mustCall());
212
213// Check error thrown on invalid values of bufferSize

Callers 1

test-fs-opendir.jsFile · 0.85

Calls 2

opendirMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…