8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
There was 8000 an error while loading. Please reload this page.
assert.fail
1 parent 88692d8 commit e74a8daCopy full SHA for e74a8da
lib/internal/assert/assertion_error.js
@@ -441,6 +441,7 @@ class AssertionError extends Error {
441
442
this.generatedMessage = !message;
443
ObjectDefineProperty(this, 'name', {
444
+ __proto__: null,
445
value: 'AssertionError [ERR_ASSERTION]',
446
enumerable: false,
447
writable: true,
test/parallel/test-assert-fail.js
@@ -1,6 +1,6 @@
1
'use strict';
2
3
-require('../common');
+const common = require('../common');
4
const assert = require('assert');
5
6
// No args
@@ -38,3 +38,7 @@ assert.throws(() => {
38
name: 'TypeError',
39
message: 'custom message'
40
});
41
+
42
+Object.prototype.get = common.mustNotCall();
43
+assert.throws(() => assert.fail(''), { code: 'ERR_ASSERTION' });
44
+delete Object.prototype.get;
0 commit comments