From 900953a65a7cb54eb8d11eba4a30e52da7dbb469 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 9 Feb 2021 15:31:46 +0000 Subject: fix(op_crates): Don't use `Deno.inspect` in op crates (#9332) Co-authored-by: Yoshiya Hinosawa --- cli/tests/084_worker_custom_inspect.ts | 4 ++++ cli/tests/084_worker_custom_inspect.ts.out | 2 ++ cli/tests/084_worker_custom_inspect_worker.ts | 2 ++ cli/tests/integration_tests.rs | 5 +++++ cli/tests/unit/event_test.ts | 5 +---- 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 cli/tests/084_worker_custom_inspect.ts create mode 100644 cli/tests/084_worker_custom_inspect.ts.out create mode 100644 cli/tests/084_worker_custom_inspect_worker.ts (limited to 'cli/tests') diff --git a/cli/tests/084_worker_custom_inspect.ts b/cli/tests/084_worker_custom_inspect.ts new file mode 100644 index 000000000..2e7b86a4e --- /dev/null +++ b/cli/tests/084_worker_custom_inspect.ts @@ -0,0 +1,4 @@ +new Worker( + new URL("084_worker_custom_inspect_worker.ts", import.meta.url).href, + { type: "module" }, +); diff --git a/cli/tests/084_worker_custom_inspect.ts.out b/cli/tests/084_worker_custom_inspect.ts.out new file mode 100644 index 000000000..b34300c40 --- /dev/null +++ b/cli/tests/084_worker_custom_inspect.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]ReadableStream { locked: false } +[WILDCARD] diff --git a/cli/tests/084_worker_custom_inspect_worker.ts b/cli/tests/084_worker_custom_inspect_worker.ts new file mode 100644 index 000000000..5be82724e --- /dev/null +++ b/cli/tests/084_worker_custom_inspect_worker.ts @@ -0,0 +1,2 @@ +console.log(new ReadableStream()); +close(); diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 33259583a..f4327212f 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2685,6 +2685,11 @@ console.log("finish"); assert_eq!(out, ""); } + itest!(_084_worker_custom_inspect { + args: "run --allow-read 084_worker_custom_inspect.ts", + output: "084_worker_custom_inspect.ts.out", + }); + itest!(js_import_detect { args: "run --quiet --reload js_import_detect.ts", output: "js_import_detect.ts.out", diff --git a/cli/tests/unit/event_test.ts b/cli/tests/unit/event_test.ts index a2a6c6e3d..149509c9d 100644 --- a/cli/tests/unit/event_test.ts +++ b/cli/tests/unit/event_test.ts @@ -124,9 +124,6 @@ unitTest(function eventInspectOutput(): void { ]; for (const [event, outputProvider] of cases) { - assertEquals( - event[Symbol.for("Deno.customInspect")](), - outputProvider(event), - ); + assertEquals(Deno.inspect(event), outputProvider(event)); } }); -- cgit v1.2.3