test: improve assert messages · nodejs/node@a93d3eb
@@ -32,7 +32,8 @@ try {
3232assert.strictEqual(e.errno, 'ETIMEDOUT');
3333err = 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}`);
3637assert.strictEqual(caught, true, 'execSync should throw');
3738const end = Date.now() - start;
3839assert(end < SLEEP);
@@ -53,11 +54,11 @@ cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
5354ret = execSync(cmd);
54555556assert.strictEqual(ret.length, msgBuf.length);
56-assert.deepStrictEqual(ret, msgBuf, 'execSync result buffer should match');
57+assert.deepStrictEqual(ret, msgBuf);
57585859ret = execSync(cmd, { encoding: 'utf8' });
596060-assert.strictEqual(ret, `${msg}\n`, 'execSync encoding result should match');
61+assert.strictEqual(ret, `${msg}\n`);
61626263const args = [
6364'-e',
@@ -69,8 +70,7 @@ assert.deepStrictEqual(ret, msgBuf);
69707071ret = execFileSync(process.execPath, args, { encoding: 'utf8' });
717272-assert.strictEqual(ret, `${msg}\n`,
73-'execFileSync encoding result should match');
73+assert.strictEqual(ret, `${msg}\n`);
74747575// Verify that the cwd option works - GH #7824
7676{