Skip to content

Commit

Permalink
test: add tests for console.assert
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
evanlucas authored and Myles Borins committed May 18, 2016
1 parent 620a261 commit 06e5faf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ assert.ok(/^__proto__: \d+ms$/.test(strings.shift().trim()));
assert.ok(/^constructor: \d+ms$/.test(strings.shift().trim()));
assert.ok(/^hasOwnProperty: \d+ms$/.test(strings.shift().trim()));
assert.equal(strings.length, 0);

assert.throws(() => {
console.assert(false, 'should throw');
}, /should throw/);

assert.doesNotThrow(() => {
console.assert(true, 'this should not throw');
});

0 comments on commit 06e5faf

Please sign in to comment.