Skip to content

Commit

Permalink
test: add "mustCall" to test-fs-readfile-unlink
Browse files Browse the repository at this point in the history
Add common.mustCall to test-fs-readfile-unlink

PR-URL: #27453
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
wuchenkai authored and targos committed Apr 29, 2019
1 parent b6c65c1 commit c1b0465
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-fs-readfile-unlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
const common = require('../common');

// Test that unlink succeeds immediately after readFile completes.

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

fs.writeFileSync(fileName, buf);

fs.readFile(fileName, function(err, data) {
fs.readFile(fileName, common.mustCall((err, data) => {
assert.ifError(err);
assert.strictEqual(data.length, buf.length);
assert.strictEqual(buf[0], 42);

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

0 comments on commit c1b0465

Please sign in to comment.