Skip to content

Commit bf1bf28

Browse files
ericljpembertonMylesBorins
authored andcommitted
test: improve assert messages
PR-URL: #15972 Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 0c0717c commit bf1bf28

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ try {
3232
assert.strictEqual(e.errno, 'ETIMEDOUT');
3333
err = e;
3434
} finally {
35-
assert.strictEqual(ret, undefined, 'we should not have a return value');
35+
assert.strictEqual(ret, undefined,
36+
`should not have a return value, received ${ret}`);
3637
assert.strictEqual(caught, true, 'execSync should throw');
3738
const end = Date.now() - start;
3839
assert(end < SLEEP);
@@ -53,11 +54,11 @@ cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
5354
ret = execSync(cmd);
5455

5556
assert.strictEqual(ret.length, msgBuf.length);
56-
assert.deepStrictEqual(ret, msgBuf, 'execSync result buffer should match');
57+
assert.deepStrictEqual(ret, msgBuf);
5758

5859
ret = execSync(cmd, { encoding: 'utf8' });
5960

60-
assert.strictEqual(ret, `${msg}\n`, 'execSync encoding result should match');
61+
assert.strictEqual(ret, `${msg}\n`);
6162

6263
const args = [
6364
'-e',
@@ -69,8 +70,7 @@ assert.deepStrictEqual(ret, msgBuf);
6970

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

72-
assert.strictEqual(ret, `${msg}\n`,
73-
'execFileSync encoding result should match');
73+
assert.strictEqual(ret, `${msg}\n`);
7474

7575
// Verify that the cwd option works - GH #7824
7676
{

0 commit comments

Comments
 (0)