From f015eec2ba4bf05d921343d3a7e04a2cab1f2b84 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 0898e964069204..0183ca3906ba29 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -166,6 +166,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);