-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: refactor fs.write() test #16827
Conversation
test/parallel/test-fs-write.js
Outdated
})); | ||
}); | ||
|
||
fs.write(fd, '', 0, 'utf8', function(err, written) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There probably needs to be a common.mustCall()
for this callback as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this:
const written = common.mustCall(function(err, written) {
assert.strictEqual(0, written);
});
fs.write(fd, '', 0, 'utf8', written);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either inline or not, doesn't really matter.
test/parallel/test-fs-write.js
Outdated
assert.strictEqual(expected, found); | ||
}); | ||
|
||
fs.write(fd, '', 0, 'utf8', (err, written) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
AIX failure is unrelated (and now fixed if you want to do a re-run but I don't think that's necessary). |
PR-URL: #16827 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Landed in 8215c67 , thanks! |
PR-URL: #16827 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
…y to resolve conflicts from nodejs#16822 and nodejs#16827
PR-URL: #16827 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Refactored fs.write() tests to use
done
, thanks for your help @mcollina.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes