diff options
author | wuchenkai <wuchenkai@bytedance.com> | 2019-04-28 16:48:27 +0800 |
---|---|---|
committer | Weijia Wang <381152119@qq.com> | 2019-04-29 20:50:55 +0800 |
commit | 413256d5e8fe01955b8666fea7f1fb29d072fa55 (patch) | |
tree | fcabd5d12a57238fee0d39cb183aafe2cd508f84 /test/parallel/test-fs-readfile-unlink.js | |
parent | 5f6438f62537779eff6402688cbe7ef30b63202e (diff) | |
download | android-node-v8-413256d5e8fe01955b8666fea7f1fb29d072fa55.tar.gz android-node-v8-413256d5e8fe01955b8666fea7f1fb29d072fa55.tar.bz2 android-node-v8-413256d5e8fe01955b8666fea7f1fb29d072fa55.zip |
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 <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>
Diffstat (limited to 'test/parallel/test-fs-readfile-unlink.js')
-rw-r--r-- | test/parallel/test-fs-readfile-unlink.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/parallel/test-fs-readfile-unlink.js b/test/parallel/test-fs-readfile-unlink.js index 1ed6fefb5c..3ff9b6ac90 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); -}); +})); |