summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-03-20 10:08:28 -0700
committerRich Trott <rtrott@gmail.com>2019-03-22 11:15:39 -0700
commit6e9551e1b1b7e204b1e5497606c43dae59a16523 (patch)
treeef822b4783c065717995843cd92e89b7bf3c4fc5 /test
parent91be64b9d3a898fd9a611368b84e888de57cd087 (diff)
downloadandroid-node-v8-6e9551e1b1b7e204b1e5497606c43dae59a16523.tar.gz
android-node-v8-6e9551e1b1b7e204b1e5497606c43dae59a16523.tar.bz2
android-node-v8-6e9551e1b1b7e204b1e5497606c43dae59a16523.zip
test: complete console.assert() coverage
There is one condition in the `console.assert()` code that is not tested currently. Add a test to confirm that `console.assert(false)` does not include a `:` in its output. PR-URL: https://github.com/nodejs/node/pull/26827 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-console.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js
index 87ee8ad1ff..65e1645f7b 100644
--- a/test/parallel/test-console.js
+++ b/test/parallel/test-console.js
@@ -193,6 +193,9 @@ console.assert(false, '%s should', 'console.assert', 'not throw');
assert.strictEqual(errStrings[errStrings.length - 1],
'Assertion failed: console.assert should not throw\n');
+console.assert(false);
+assert.strictEqual(errStrings[errStrings.length - 1], 'Assertion failed\n');
+
console.assert(true, 'this should not throw');
console.assert(true);