mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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>
This commit is contained in:
1 parent
04e9d5a448
commit
41bd7a62e9
1 file changed
+3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user