Skip to content

Commit 06e5faf

Browse files
evanlucasMyles Borins
authored andcommitted
test: add tests for console.assert
There were previously no tests where console.assert failed PR-URL: #6302 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 620a261 commit 06e5faf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-console.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ assert.ok(/^__proto__: \d+ms$/.test(strings.shift().trim()));
7373
assert.ok(/^constructor: \d+ms$/.test(strings.shift().trim()));
7474
assert.ok(/^hasOwnProperty: \d+ms$/.test(strings.shift().trim()));
7575
assert.equal(strings.length, 0);
76+
77+
assert.throws(() => {
78+
console.assert(false, 'should throw');
79+
}, /should throw/);
80+
81+
assert.doesNotThrow(() => {
82+
console.assert(true, 'this should not throw');
83+
});

0 commit comments

Comments
 (0)