Skip to content

Commit adceca4

Browse files
ericljpembertonMylesBorins
authored andcommitted
test: improve assert messages
PR-URL: #15972 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent ab046be commit adceca4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/sequential/test-child-process-execsync.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ try {
5353
assert.strictEqual(e.errno, 'ETIMEDOUT');
5454
err = e;
5555
} finally {
56-
assert.strictEqual(ret, undefined, 'we should not have a return value');
56+
assert.strictEqual(ret, undefined,
57+
`should not have a return value, received ${ret}`);
5758
assert.strictEqual(caught, true, 'execSync should throw');
5859
const end = Date.now() - start;
5960
assert(end < SLEEP);
@@ -74,11 +75,11 @@ cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
7475
ret = execSync(cmd);
7576

7677
assert.strictEqual(ret.length, msgBuf.length);
77-
assert.deepStrictEqual(ret, msgBuf, 'execSync result buffer should match');
78+
assert.deepStrictEqual(ret, msgBuf);
7879

7980
ret = execSync(cmd, { encoding: 'utf8' });
8081

81-
assert.strictEqual(ret, `${msg}\n`, 'execSync encoding result should match');
82+
assert.strictEqual(ret, `${msg}\n`);
8283

8384
const args = [
8485
'-e',
@@ -90,8 +91,7 @@ assert.deepStrictEqual(ret, msgBuf);
9091

9192
ret = execFileSync(process.execPath, args, { encoding: 'utf8' });
9293

93-
assert.strictEqual(ret, `${msg}\n`,
94-
'execFileSync encoding result should match');
94+
assert.strictEqual(ret, `${msg}\n`);
9595

9696
// Verify that the cwd option works - GH #7824
9797
{

0 commit comments

Comments
 (0)