summaryrefslogtreecommitdiff
path: root/test/sequential
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
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')
-rw-r--r--test/sequential/test-cli-syntax-bad.js3
-rw-r--r--test/sequential/test-cli-syntax-file-not-found.js3
-rw-r--r--test/sequential/test-cli-syntax-require.js3
3 files changed, 6 insertions, 3 deletions
diff --git a/test/sequential/test-cli-syntax-bad.js b/test/sequential/test-cli-syntax-bad.js
index e1c7f3bec5..7c4c9c70d9 100644
--- a/test/sequential/test-cli-syntax-bad.js
+++ b/test/sequential/test-cli-syntax-bad.js
@@ -32,7 +32,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, '');
diff --git a/test/sequential/test-cli-syntax-file-not-found.js b/test/sequential/test-cli-syntax-file-not-found.js
index 848e2fe231..b90033a396 100644
--- a/test/sequential/test-cli-syntax-file-not-found.js
+++ b/test/sequential/test-cli-syntax-file-not-found.js
@@ -33,7 +33,8 @@ const notFoundRE = /^Error: Cannot find module/m;
// stderr should have a module not found error message
assert(notFoundRE.test(stderr), `${notFoundRE} === ${stderr}`);
- assert.strictEqual(err.code, 1);
+ assert.strictEqual(err.code, 1,
+ `code ${err.code} !== 1 for error:\n\n${err}`);
}));
});
});
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, '');