Skip to content

Commit

Permalink
test: usemustSucceed instead of mustCall with assert.ifError
Browse files Browse the repository at this point in the history
PR-URL: #42806
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
fossamagna authored and RafaelGSS committed May 10, 2022
1 parent 2dc7956 commit b1c18ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-fs-opendir.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,16 @@ const invalidCallbackObj = {
// Check the opendir async version
fs.opendir(testDir, common.mustSucceed((dir) => {
let sync = true;
dir.read(common.mustCall((err, dirent) => {
dir.read(common.mustSucceed((dirent) => {
assert(!sync);
assert.ifError(err);

// Order is operating / file system dependent
assert(files.includes(dirent.name), `'files' should include ${dirent}`);
assertDirent(dirent);

let syncInner = true;
dir.read(common.mustCall((err, dirent) => {
dir.read(common.mustSucceed((dirent) => {
assert(!syncInner);
assert.ifError(err);

dir.close(common.mustSucceed());
}));
Expand Down

0 comments on commit b1c18ed

Please sign in to comment.