summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorabouthiroppy <git@about-hiroppy.com>2017-01-20 13:31:28 +0900
committerMyles Borins <myles.borins@gmail.com>2017-03-08 17:11:17 -0800
commitb45280671a98b75e7d156fb499e46baf9ff74100 (patch)
tree9576a3190ace63422f20e0fb902550d31b031178 /test
parentdb45bf850a2b7bd19d56694cf81f10f2490f95b7 (diff)
downloadnode-new-b45280671a98b75e7d156fb499e46baf9ff74100.tar.gz
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>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-process-assert.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-process-assert.js b/test/parallel/test-process-assert.js
new file mode 100644
index 0000000000..e386c3d760
--- /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$/);