Skip to content

Commit df7e577

Browse files
committed
fixup! util: add non-default depth 1 test case
See #60684 (comment)
1 parent 83db54c commit df7e577

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/parallel/test-util-inspect.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,18 @@ assert.strictEqual(
26412641
});
26422642
const thrower = Object.defineProperty({}, 'foo', recursivelyThrowingErrorDesc);
26432643

2644+
assert.strictEqual(
2645+
inspect(thrower, { getters: true, depth: 1 }),
2646+
'{\n' +
2647+
' foo: [Getter: <Inspection threw ([object Error] {\n' +
2648+
' stack: [Getter/Setter: <Inspection threw ([Error])>],\n' +
2649+
' cause: [Getter: <Inspection threw ([Error])>],\n' +
2650+
' name: [Getter: <Inspection threw ([Error])>],\n' +
2651+
' message: [Getter: <Inspection threw ([Error])>]\n' +
2652+
' })>]\n' +
2653+
'}'
2654+
);
2655+
26442656
assert.strictEqual(
26452657
inspect(thrower, { getters: true, depth: 2 }),
26462658
'{\n' +

0 commit comments

Comments
 (0)