Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: use mustSucceed in test-fs-read
This commit refactors the callback in test/parallel/test-fs-read.js
to use common.mustSucceed() instead of common.mustCall().

common.mustSucceed() is the preferred helper for standard error-first
callbacks that are expected to succeed, as it provides an explicit
check that the `err` argument is null. This improves the clarity
and robustness of the test.
  • Loading branch information
mete0rfish committed Jul 25, 2025
commit aa27596ff70b40b86763f25aca7b2dfa566e08c1
2 changes: 1 addition & 1 deletion test/parallel/test-fs-read-zero-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fd = fs.openSync(filepath, 'r');
const bufferAsync = Buffer.alloc(0);
const bufferSync = Buffer.alloc(0);

fs.read(fd, bufferAsync, 0, 0, 0, common.mustCall((err, bytesRead) => {
fs.read(fd, bufferAsync, 0, 0, 0, common.mustSucceed((bytesRead) => {
assert.strictEqual(bytesRead, 0);
assert.deepStrictEqual(bufferAsync, Buffer.alloc(0));
}));
Expand Down
Loading