mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/13285 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>v6
committed by
Michael Dawson
6 changed files with 74 additions and 32 deletions
@ -1,11 +1,21 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
assert.strictEqual(process.assert(1, 'error'), undefined); |
|||
assert.throws(() => { |
|||
process.assert(undefined, 'errorMessage'); |
|||
}, /^Error: errorMessage$/); |
|||
}, common.expectsError({ |
|||
code: 'ERR_ASSERTION', |
|||
type: Error, |
|||
message: 'errorMessage' |
|||
}) |
|||
); |
|||
assert.throws(() => { |
|||
process.assert(false); |
|||
}, /^Error: assertion error$/); |
|||
}, common.expectsError({ |
|||
code: 'ERR_ASSERTION', |
|||
type: Error, |
|||
message: 'assertion error' |
|||
}) |
|||
); |
|||
|
Loading…
Reference in new issue