mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
assert: add internal assert.fail()
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>
This commit is contained in:
1 parent
21e6d353af
commit
ccf60bbad2
2 files changed
+8
No files matched your search
@@ -6,4 +6,10 @@ function assert(value, message) {
|
||||
}
|
||||
}
|
||||
|
||||
function fail(message) {
|
||||
require('assert').fail(message);
|
||||
}
|
||||
|
||||
assert.fail = fail;
|
||||
|
||||
module.exports = assert;
|
||||
@@ -13,3 +13,5 @@ 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' });
|
||||
Reference in new issue
Block a user