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

Function doAsyncIterTest

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

Source from the content-addressed store, hash-verified

158
159// Async iterator
160async function doAsyncIterTest() {
161 const entries = [];
162 for await (const dirent of await fs.promises.opendir(testDir)) {
163 entries.push(dirent.name);
164 assertDirent(dirent);
165 }
166
167 assert.deepStrictEqual(files, entries.sort());
168
169 // Automatically closed during iterator
170}
171doAsyncIterTest().then(common.mustCall());
172
173// Async iterators should do automatic cleanup

Callers 1

test-fs-opendir.jsFile · 0.85

Calls 4

assertDirentFunction · 0.85
opendirMethod · 0.80
sortMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…