From c1b04652f550cf6723107e95379ce846541eb949 Mon Sep 17 00:00:00 2001 From: wuchenkai Date: Sun, 28 Apr 2019 16:48:27 +0800 Subject: [PATCH] test: add "mustCall" to test-fs-readfile-unlink Add common.mustCall to test-fs-readfile-unlink PR-URL: https://github.com/nodejs/node/pull/27453 Reviewed-By: Joyee Cheung Reviewed-By: Yongsheng Zhang Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig --- test/parallel/test-fs-readfile-unlink.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-fs-readfile-unlink.js b/test/parallel/test-fs-readfile-unlink.js index 1ed6fefb5ccfc7..3ff9b6ac9029fe 100644 --- a/test/parallel/test-fs-readfile-unlink.js +++ b/test/parallel/test-fs-readfile-unlink.js @@ -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. @@ -37,7 +37,7 @@ 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); @@ -45,4 +45,4 @@ fs.readFile(fileName, function(err, data) { // Unlink should not throw. This is part of the test. It used to throw on // Windows due to a bug. fs.unlinkSync(fileName); -}); +}));