Skip to content

Commit feec26d

Browse files
mete0rfishaduh95
authored andcommitted
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. PR-URL: #59204 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent b30a211 commit feec26d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-fs-read-zero-length.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fd = fs.openSync(filepath, 'r');
88
const bufferAsync = Buffer.alloc(0);
99
const bufferSync = Buffer.alloc(0);
1010

11-
fs.read(fd, bufferAsync, 0, 0, 0, common.mustCall((err, bytesRead) => {
11+
fs.read(fd, bufferAsync, 0, 0, 0, common.mustSucceed((bytesRead) => {
1212
assert.strictEqual(bytesRead, 0);
1313
assert.deepStrictEqual(bufferAsync, Buffer.alloc(0));
1414
}));

0 commit comments

Comments
 (0)