Skip to content

Commit 84ebf2b

Browse files
evanlucasjasnell
authored andcommitted
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 6815a3b commit 84ebf2b

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
@@ -83,3 +83,11 @@ assert.ok(/^__proto__: \d+\.\d{3}ms$/.test(strings.shift().trim()));
8383
assert.ok(/^constructor: \d+\.\d{3}ms$/.test(strings.shift().trim()));
8484
assert.ok(/^hasOwnProperty: \d+\.\d{3}ms$/.test(strings.shift().trim()));
8585
assert.equal(strings.length, 0);
86+
87+
assert.throws(() => {
88+
console.assert(false, 'should throw');
89+
}, /should throw/);
90+
91+
assert.doesNotThrow(() => {
92+
console.assert(true, 'this should not throw');
93+
});

0 commit comments

Comments
 (0)