Skip to content

Commit

Permalink
test: complete console.assert() coverage
Browse files Browse the repository at this point in the history
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: nodejs#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>
  • Loading branch information
Trott committed Mar 22, 2019
1 parent 91be64b commit 6e9551e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-console.js
Expand Up @@ -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);
Expand Down

0 comments on commit 6e9551e

Please sign in to comment.