test: add tests for console.assert

There were previously no tests where console.assert failed

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Evan Lucas 2016-04-20 08:32:09 -05:00 коммит произвёл James M Snell
Родитель 6815a3b7f9
Коммит 84ebf2b40d
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -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');
});