From 9e7f8fc976c8b4a8c78aec4ad6745b0bdbc52d5f 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. --- 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);