Skip to content

Commit

Permalink
test: improve assert messages
Browse files Browse the repository at this point in the history
PR-URL: #15972
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
ericljpemberton authored and MylesBorins committed Oct 25, 2017
1 parent f9cb428 commit a93d3eb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/sequential/test-child-process-execsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ try {
assert.strictEqual(e.errno, 'ETIMEDOUT');
err = e;
} finally {
assert.strictEqual(ret, undefined, 'we should not have a return value');
assert.strictEqual(ret, undefined,
`should not have a return value, received ${ret}`);
assert.strictEqual(caught, true, 'execSync should throw');
const end = Date.now() - start;
assert(end < SLEEP);
Expand All @@ -53,11 +54,11 @@ cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
ret = execSync(cmd);

assert.strictEqual(ret.length, msgBuf.length);
assert.deepStrictEqual(ret, msgBuf, 'execSync result buffer should match');
assert.deepStrictEqual(ret, msgBuf);

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

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

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

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

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

// Verify that the cwd option works - GH #7824
{
Expand Down

0 comments on commit a93d3eb

Please sign in to comment.