Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ba354a

Browse filesBrowse files
Nievltargos
authored andcommitted
test: add test for util.inspect
add test case for util.inspect with 'depth' option set to 'null' and with that has a custom inspect function attached PR-URL: #27906 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
1 parent f621b8f commit 3ba354a
Copy full SHA for 3ba354a

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,13 @@ util.inspect({ hasOwnProperty: null });
852852
util.inspect(subject, { customInspectOptions: true, seen: null });
853853
}
854854

855+
{
856+
const subject = { [util.inspect.custom]: common.mustCall((depth) => {
857+
assert.strictEqual(depth, null);
858+
}) };
859+
util.inspect(subject, { depth: null });
860+
}
861+
855862
{
856863
// Returning `this` from a custom inspection function works.
857864
const subject = { a: 123, [util.inspect.custom]() { return this; } };

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.