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 <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
keldorus authored and cjihrig committed Nov 7, 2017
1 parent 527ddda commit a409b87
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/parallel/test-fs-readfile-pipe-large.js
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 a409b87

Please sign in to comment.