Skip to content

Commit 41bd7a6

Browse files
Trotttargos
authored andcommitted
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: #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>
1 parent 04e9d5a commit 41bd7a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/parallel/test-console.js

+3
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ console.assert(false, '%s should', 'console.assert', 'not throw');
193193
assert.strictEqual(errStrings[errStrings.length - 1],
194194
'Assertion failed: console.assert should not throw\n');
195195

196+
console.assert(false);
197+
assert.strictEqual(errStrings[errStrings.length - 1], 'Assertion failed\n');
198+
196199
console.assert(true, 'this should not throw');
197200

198201
console.assert(true);

0 commit comments

Comments
 (0)