From 7a35077197fc1b3bacbe057ffc6caaeb8199cd8a Mon Sep 17 00:00:00 2001 From: tonyhty Date: Sun, 28 Apr 2019 16:51:00 +0800 Subject: [PATCH] test: add mustCall to test-fs-readfile-pipe PR-URL: https://github.com/nodejs/node/pull/27450 Reviewed-By: Yorkie Liu Reviewed-By: Weijia Wang Reviewed-By: Gireesh Punathil Reviewed-By: Colin Ihrig --- test/parallel/test-fs-readfile-pipe.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-fs-readfile-pipe.js b/test/parallel/test-fs-readfile-pipe.js index 861ce20cfc798d..a21801e3890894 100644 --- a/test/parallel/test-fs-readfile-pipe.js +++ b/test/parallel/test-fs-readfile-pipe.js @@ -31,10 +31,10 @@ const assert = require('assert'); const fs = require('fs'); if (process.argv[2] === 'child') { - fs.readFile('/dev/stdin', function(er, data) { + fs.readFile('/dev/stdin', common.mustCall(function(er, data) { assert.ifError(er); process.stdout.write(data); - }); + })); return; } @@ -47,7 +47,7 @@ const exec = require('child_process').exec; const f = JSON.stringify(__filename); const node = JSON.stringify(process.execPath); const cmd = `cat ${filename} | ${node} ${f} child`; -exec(cmd, function(err, stdout, stderr) { +exec(cmd, common.mustCall(function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual( stdout, @@ -58,4 +58,4 @@ exec(cmd, function(err, stdout, stderr) { '', `expected not to read anything from stderr but got: '${stderr}'`); console.log('ok'); -}); +}));