From a93d3eb79d1003ceb8861d1b52c0b90d73f3f2b6 Mon Sep 17 00:00:00 2001 From: Eric Pemberton Date: Fri, 6 Oct 2017 10:38:56 -0700 Subject: [PATCH] test: improve assert messages PR-URL: https://github.com/nodejs/node/pull/15972 Reviewed-By: Ruben Bridgewater --- test/sequential/test-child-process-execsync.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index cccd3b7e77d6f3..e7c978406c883e 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -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); @@ -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', @@ -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 {