diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 16ea2a40e803f4..ac576ec7cbf9d2 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -852,6 +852,13 @@ util.inspect({ hasOwnProperty: null }); util.inspect(subject, { customInspectOptions: true, seen: null }); } +{ + const subject = { [util.inspect.custom]: common.mustCall((depth) => { + assert.strictEqual(depth, null); + }) }; + util.inspect(subject, { depth: null }); +} + { // Returning `this` from a custom inspection function works. const subject = { a: 123, [util.inspect.custom]() { return this; } };