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 juanarbol committed May 31, 2022
1 parent 8bb7f56 commit db1d714
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 db1d714

Please sign in to comment.