From b038f30df7f20a5c354f20b164c4c87758edccbd Mon Sep 17 00:00:00 2001 From: abouthiroppy Date: Fri, 20 Jan 2017 13:31:28 +0900 Subject: [PATCH] test: add process.assert's test process.assert: https://github.com/nodejs/node/blob/master/lib/internal/process.js#L21 --- test/parallel/test-process-assert.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/parallel/test-process-assert.js diff --git a/test/parallel/test-process-assert.js b/test/parallel/test-process-assert.js new file mode 100644 index 00000000000000..e386c3d7600c06 --- /dev/null +++ b/test/parallel/test-process-assert.js @@ -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$/);