16 lines
429 B
JavaScript
16 lines
429 B
JavaScript
|
// Flags: --expose-internals
|
||
|
'use strict';
|
||
|
|
||
|
require('../common');
|
||
|
|
||
|
const assert = require('assert');
|
||
|
const internalAssert = require('internal/assert');
|
||
|
|
||
|
// Should not throw.
|
||
|
internalAssert(true);
|
||
|
internalAssert(true, 'fhqwhgads');
|
||
|
|
||
|
assert.throws(() => { internalAssert(false); }, assert.AssertionError);
|
||
|
assert.throws(() => { internalAssert(false, 'fhqwhgads'); },
|
||
|
{ code: 'ERR_ASSERTION', message: 'fhqwhgads' });
|