diff options
Diffstat (limited to 'lib/internal/assert.js')
-rw-r--r-- | lib/internal/assert.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/internal/assert.js b/lib/internal/assert.js index 29769fc561..4e059db6b9 100644 --- a/lib/internal/assert.js +++ b/lib/internal/assert.js @@ -395,6 +395,14 @@ class AssertionError extends Error { this.operator = operator; Error.captureStackTrace(this, stackStartFn); } + + [inspect.custom](recurseTimes, ctx) { + // This limits the `actual` and `expected` property default inspection to + // the minimum depth. Otherwise those values would be too verbose compared + // to the actual error message which contains a combined view of these two + // input values. + return inspect(this, { ...ctx, customInspect: false, depth: 0 }); + } } module.exports = { |