From 268a3bc6d67465bc515aec6c113e4f56750810b8 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Wed, 20 Apr 2016 08:32:09 -0500 Subject: [PATCH] test: add tests for console.assert There were previously no tests where console.assert failed --- test/parallel/test-console.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 4a5befd2e343ae..8540db6169b09c 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -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'); +});