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

Function doPromiseTest

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

Source from the content-addressed store, hash-verified

135
136// Promise-based tests
137async function doPromiseTest() {
138 // Check the opendir Promise version
139 const dir = await fs.promises.opendir(testDir);
140 assertDir(dir);
141 const entries = [];
142
143 let i = files.length;
144 while (i--) {
145 const dirent = await dir.read();
146 entries.push(dirent.name);
147 assertDirent(dirent);
148 }
149
150 assert.deepStrictEqual(files, entries.sort());
151
152 // dir.read should return null when no more entries exist
153 assert.strictEqual(await dir.read(), null);
154
155 await dir.close();
156}
157doPromiseTest().then(common.mustCall());
158
159// Async iterator

Callers 1

test-fs-opendir.jsFile · 0.85

Calls 7

assertDirFunction · 0.85
assertDirentFunction · 0.85
opendirMethod · 0.80
sortMethod · 0.80
closeMethod · 0.65
readMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…