Skip to content

Commit 6ca9901

Browse files
hiroppyMylesBorins
authored andcommitted
test: add process.assert's test
PR-URL: #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>
1 parent c9a92ff commit 6ca9901

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/parallel/test-process-assert.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
5+
assert.strictEqual(process.assert(1, 'error'), undefined);
6+
assert.throws(() => {
7+
process.assert(undefined, 'errorMessage');
8+
}, /^Error: errorMessage$/);
9+
assert.throws(() => {
10+
process.assert(false);
11+
}, /^Error: assertion error$/);

0 commit comments

Comments
 (0)