Skip to content

Commit c1b0465

Browse files
wuchenkaitargos
wuchenkai
authored andcommitted
test: add "mustCall" to test-fs-readfile-unlink
Add common.mustCall to test-fs-readfile-unlink PR-URL: #27453 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent b6c65c1 commit c1b0465

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-fs-readfile-unlink.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
require('../common');
23+
const common = require('../common');
2424

2525
// Test that unlink succeeds immediately after readFile completes.
2626

@@ -37,12 +37,12 @@ tmpdir.refresh();
3737

3838
fs.writeFileSync(fileName, buf);
3939

40-
fs.readFile(fileName, function(err, data) {
40+
fs.readFile(fileName, common.mustCall((err, data) => {
4141
assert.ifError(err);
4242
assert.strictEqual(data.length, buf.length);
4343
assert.strictEqual(buf[0], 42);
4444

4545
// Unlink should not throw. This is part of the test. It used to throw on
4646
// Windows due to a bug.
4747
fs.unlinkSync(fileName);
48-
});
48+
}));

0 commit comments

Comments
 (0)