Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add tests for console.assert
There were previously no tests where console.assert failed
  • Loading branch information
evanlucas committed Apr 20, 2016
commit 268a3bc6d67465bc515aec6c113e4f56750810b8
8 changes: 8 additions & 0 deletions test/parallel/test-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ assert.ok(/^__proto__: \d+\.\d{3}ms$/.test(strings.shift().trim()));
assert.ok(/^constructor: \d+\.\d{3}ms$/.test(strings.shift().trim()));
assert.ok(/^hasOwnProperty: \d+\.\d{3}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');
});