summaryrefslogtreecommitdiff
path: root/test/sequential/test-child-process-execsync.js
diff options
context:
space:
mode:
authorEric Pemberton <eric.pemberton@bazaarvoice.com>2017-10-06 10:38:56 -0700
committerRuben Bridgewater <ruben@bridgewater.de>2017-10-08 15:05:01 -0700
commit55bb9c41284d49bf4f1ebbb674d4ba9cad7508d5 (patch)
tree9a92923023e24002ddddf854955d082b2454325b /test/sequential/test-child-process-execsync.js
parent96eba098ef4c62cda87623285bbfe9c0a1fb7b11 (diff)
downloadandroid-node-v8-55bb9c41284d49bf4f1ebbb674d4ba9cad7508d5.tar.gz
android-node-v8-55bb9c41284d49bf4f1ebbb674d4ba9cad7508d5.tar.bz2
android-node-v8-55bb9c41284d49bf4f1ebbb674d4ba9cad7508d5.zip
test: improve assert messages
PR-URL: https://github.com/nodejs/node/pull/15972 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/sequential/test-child-process-execsync.js')
-rw-r--r--test/sequential/test-child-process-execsync.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js
index 63046517a9..94810e890c 100644
--- a/test/sequential/test-child-process-execsync.js
+++ b/test/sequential/test-child-process-execsync.js
@@ -53,7 +53,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);
@@ -74,11 +75,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',
@@ -90,8 +91,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
{