Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a93d3eb

Browse filesBrowse files
ericljpembertonMylesBorins
authored andcommitted
test: improve assert messages
PR-URL: #15972 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent f9cb428 commit a93d3eb
Copy full SHA for a93d3eb

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/sequential/test-child-process-execsync.js
+5-5Lines changed: 5 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.