diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 5af14fe60b0836..d3ca1ea1a6bdaf 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -16,6 +16,7 @@ const { JSONStringify, Map, MathAbs, + MathMax, NumberIsInteger, ObjectDefineProperty, ObjectKeys, @@ -700,7 +701,11 @@ const fatalExceptionStackEnhancers = { require('internal/tty').hasColors()) || defaultColors); try { - return inspect(error, { colors }); + return inspect(error, { + colors, + customInspect: false, + depth: MathMax(inspect.defaultOptions.depth, 5) + }); } catch { return originalStack; } diff --git a/test/message/assert_throws_stack.out b/test/message/assert_throws_stack.out index e9f9cc5e891c37..a2da1f2b6c5b37 100644 --- a/test/message/assert_throws_stack.out +++ b/test/message/assert_throws_stack.out @@ -29,6 +29,6 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: at * at * at *, - expected: [Object], + expected: { bar: true }, operator: 'throws' }