Skip to content

Commit

Permalink
test: improve message in test-fs-readfile-pipe-large
Browse files Browse the repository at this point in the history
Improve assertion message by including expected and actual values.

PR-URL: #16840
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
keldorus authored and MylesBorins committed Nov 16, 2017
1 parent 562d8fc commit ec4c3f5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/parallel/test-fs-readfile-pipe-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ const node = JSON.stringify(process.execPath);
const cmd = `cat ${filename} | ${node} ${f} child`;
exec(cmd, { maxBuffer: 1000000 }, function(err, stdout, stderr) {
assert.ifError(err);
assert.strictEqual(stdout, dataExpected, 'it reads the file and outputs it');
assert.strictEqual(stderr, '', 'it does not write to stderr');
assert.strictEqual(
stdout,
dataExpected,
`expect it reads the file and outputs 999999 'a' but got : ${stdout}`
);
assert.strictEqual(
stderr,
'',
`expect that it does not write to stderr, but got : ${stderr}`
);
console.log('ok');
});

Expand Down

0 comments on commit ec4c3f5

Please sign in to comment.