test: add process.assert's test

PR-URL: https://github.com/nodejs/node/pull/10911
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
abouthiroppy authored and Luigi Pinca committed 2017-01-25 12:51:15 +01:00
1 parent 3bdcbdb1a0
commit aa4fe92392
1 file changed
+11
+11
View File
@@ -0,0 +1,11 @@
'use strict';
require('../common');
const assert = require('assert');
assert.strictEqual(process.assert(1, 'error'), undefined);
assert.throws(() => {
process.assert(undefined, 'errorMessage');
}, /^Error: errorMessage$/);
assert.throws(() => {
process.assert(false);
}, /^Error: assertion error$/);