Skip to content

Commit 06e5faf

Browse files
evanlucasMyles Borins
authored and
Myles Borins
committed
test: add tests for console.assert
There were previously no tests where console.assert failed PR-URL: #6302 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
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

+8
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)