aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLevin Eugene <lzhnek@gmail.com>2019-05-26 17:24:33 +0300
committerZYSzys <zyszys98@gmail.com>2019-05-28 16:31:51 +0800
commit3b50bded08c2cbcc652b79346121b4e39de231fc (patch)
tree8743c00df343435e1f977356fb50d770547cdf3a /test
parentfc7c5b9795dcb5757e6b39719d1ffbb067d32ff7 (diff)
downloadandroid-node-v8-3b50bded08c2cbcc652b79346121b4e39de231fc.tar.gz
android-node-v8-3b50bded08c2cbcc652b79346121b4e39de231fc.tar.bz2
android-node-v8-3b50bded08c2cbcc652b79346121b4e39de231fc.zip
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-util-inspect.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 16ea2a40e8..ac576ec7cb 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -853,6 +853,13 @@ util.inspect({ hasOwnProperty: 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; } };
const UIC = 'nodejs.util.inspect.custom';