Skip to content

Commit e89b6fe

Browse files
chenjian-bzhtargos
authored andcommitted
test: adding mustCall in test-fs-readfile-empty.js
PR-URL: #27455 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]>
1 parent 457549b commit e89b6fe

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

+8-9
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,26 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
require('../common');
2423

2524
// Trivial test of fs.readFile on an empty file.
26-
27-
const assert = require('assert');
25+
const common = require('../common');
2826
const fs = require('fs');
27+
const assert = require('assert');
2928
const fixtures = require('../common/fixtures');
3029

3130
const fn = fixtures.path('empty.txt');
3231

33-
fs.readFile(fn, function(err, data) {
32+
fs.readFile(fn, common.mustCall((err, data) => {
3433
assert.ok(data);
35-
});
34+
}));
3635

37-
fs.readFile(fn, 'utf8', function(err, data) {
36+
fs.readFile(fn, 'utf8', common.mustCall((err, data) => {
3837
assert.strictEqual(data, '');
39-
});
38+
}));
4039

41-
fs.readFile(fn, { encoding: 'utf8' }, function(err, data) {
40+
fs.readFile(fn, { encoding: 'utf8' }, common.mustCall((err, data) => {
4241
assert.strictEqual(data, '');
43-
});
42+
}));
4443

4544
assert.ok(fs.readFileSync(fn));
4645
assert.strictEqual(fs.readFileSync(fn, 'utf8'), '');

0 commit comments

Comments
 (0)