From 64abb65f0514afc1f10c426561e5150d9cae6b45 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Mon, 13 Jun 2022 10:59:22 -0400 Subject: feat(console): pass options and depth to custom inspects (#14855) This commit updates Deno.inspect() to pass inspect options and the current inspect depth to custom inspect functions. Refs: https://github.com/denoland/deno/issues/8099 Refs: https://github.com/denoland/deno/issues/14171 --- cli/tests/unit/console_test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index d349266e8..fbaba9e43 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -884,7 +884,14 @@ Deno.test(async function consoleTestStringifyPromises() { Deno.test(function consoleTestWithCustomInspector() { class A { - [customInspect](): string { + [customInspect]( + inspect: unknown, + options: Deno.InspectOptions, + depth: number, + ): string { + assertEquals(typeof inspect, "function"); + assertEquals(typeof options, "object"); + assertEquals(depth, 0); return "b"; } } -- cgit v1.2.3