2019-02-05 21:05:24 -08:00
|
|
|
// 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' });
|
2019-02-12 16:44:42 -08:00
|
|
|
assert.throws(() => { internalAssert.fail('fhqwhgads'); },
|
|
|
|
{ code: 'ERR_ASSERTION', message: 'fhqwhgads' });
|