Skip to content

Commit

Permalink
test: add mustCall to test-fs-readfile-pipe
Browse files Browse the repository at this point in the history
PR-URL: #27450
Reviewed-By: Yorkie Liu <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
tonyhty authored and targos committed Apr 29, 2019
1 parent af29ae0 commit 7a35077
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-fs-readfile-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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,
Expand All @@ -58,4 +58,4 @@ exec(cmd, function(err, stdout, stderr) {
'',
`expected not to read anything from stderr but got: '${stderr}'`);
console.log('ok');
});
}));

0 comments on commit 7a35077

Please sign in to comment.