summaryrefslogtreecommitdiff
path: root/test/sequential/test-cli-syntax-require.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-12-13 09:17:35 -0800
committerRich Trott <rtrott@gmail.com>2018-12-14 06:41:19 -0800
commit914c49497cd92a9266cf5aaed1f425358d1023cc (patch)
treef65a282ce160e3e52916866223b20f798729a8fd /test/sequential/test-cli-syntax-require.js
parent80ab537ee6fa5513399b86ab439d954387d88772 (diff)
downloadandroid-node-v8-914c49497cd92a9266cf5aaed1f425358d1023cc.tar.gz
android-node-v8-914c49497cd92a9266cf5aaed1f425358d1023cc.tar.bz2
android-node-v8-914c49497cd92a9266cf5aaed1f425358d1023cc.zip
test: increase error information in test-cli-syntax-*
If there is an error, but not the error code the test expects, display more information about the error. PR-URL: https://github.com/nodejs/node/pull/25021 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Diffstat (limited to 'test/sequential/test-cli-syntax-require.js')
-rw-r--r--test/sequential/test-cli-syntax-require.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/sequential/test-cli-syntax-require.js b/test/sequential/test-cli-syntax-require.js
index ed13805eb9..d99dc2ff71 100644
--- a/test/sequential/test-cli-syntax-require.js
+++ b/test/sequential/test-cli-syntax-require.js
@@ -20,7 +20,8 @@ const syntaxErrorRE = /^SyntaxError: \b/m;
const cmd = [node, ...args].join(' ');
exec(cmd, common.mustCall((err, stdout, stderr) => {
assert.strictEqual(err instanceof Error, true);
- assert.strictEqual(err.code, 1);
+ assert.strictEqual(err.code, 1,
+ `code ${err.code} !== 1 for error:\n\n${err}`);
// no stdout should be produced
assert.strictEqual(stdout, '');