mirror of
https://github.com/zebrajr/node.git
synced 2025-12-07 00:20:38 +01:00
PR-URL: https://github.com/nodejs/node/pull/26047 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
18 lines
552 B
JavaScript
18 lines
552 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' });
|
|
assert.throws(() => { internalAssert.fail('fhqwhgads'); },
|
|
{ code: 'ERR_ASSERTION', message: 'fhqwhgads' });
|