test: improve message in test-fs-readfile-pipe-large
Improve assertion message by including expected and actual values. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
2054c66e77
commit
9a1565e41a
@ -29,8 +29,16 @@ const node = JSON.stringify(process.execPath);
|
|||||||
const cmd = `cat ${filename} | ${node} ${f} child`;
|
const cmd = `cat ${filename} | ${node} ${f} child`;
|
||||||
exec(cmd, { maxBuffer: 1000000 }, function(err, stdout, stderr) {
|
exec(cmd, { maxBuffer: 1000000 }, function(err, stdout, stderr) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(stdout, dataExpected, 'it reads the file and outputs it');
|
assert.strictEqual(
|
||||||
assert.strictEqual(stderr, '', 'it does not write to stderr');
|
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');
|
console.log('ok');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user