From b45280671a98b75e7d156fb499e46baf9ff74100 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/10911 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Michaƫl Zasso Reviewed-By: Italo A. Casas Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- 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$/);