| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7d9f1f3 commit 645a97a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -708,6 +708,11 @@ exports.expectsError = function expectsError(fn, settings, exact) { | |||
| 708 | 708 | } | |
| 709 | 709 | ||
| 710 | 710 | function innerFn(error) { | |
| 711 | + if (arguments.length !== 1) { | ||
| 712 | + // Do not use `assert.strictEqual()` to prevent `util.inspect` from | ||
| 713 | + // always being called. | ||
| 714 | + assert.fail(`Expected one argument, got ${util.inspect(arguments)}`); | ||
| 715 | + } | ||
| 711 | 716 | const descriptor = Object.getOwnPropertyDescriptor(error, 'message'); | |
| 712 | 717 | assert.strictEqual(descriptor.enumerable, | |
| 713 | 718 | false, 'The error message should be non-enumerable'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments