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

Function assertDirents

test/sequential/test-fs-readdir-recursive.js:133–144  ·  view source on GitHub ↗
(dirents)

Source from the content-addressed store, hash-verified

131}
132
133function assertDirents(dirents) {
134 assert.strictEqual(dirents.length, expected.length);
135 dirents.sort((a, b) => (getDirentPath(a) < getDirentPath(b) ? -1 : 1));
136 assert.deepStrictEqual(
137 dirents.map(common.mustCallAtLeast((dirent) => {
138 assert(dirent instanceof fs.Dirent);
139 assert.notStrictEqual(dirent.name, undefined);
140 return getDirentPath(dirent);
141 })),
142 expected
143 );
144}
145
146// readdirSync
147

Callers 2

testFunction · 0.70

Calls 4

sortMethod · 0.80
getDirentPathFunction · 0.70
mapMethod · 0.65
assertFunction · 0.50

Tested by 1

testFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…