From 6e9551e1b1b7e204b1e5497606c43dae59a16523 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 20 Mar 2019 10:08:28 -0700 Subject: [PATCH] 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 Reviewed-By: Richard Lau Reviewed-By: Beth Griggs Reviewed-By: Yongsheng Zhang Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater --- test/parallel/test-console.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 87ee8ad1ff1230..65e1645f7b1e7b 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);