summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2022-06-14 19:25:58 -0400
committerColin Ihrig <cjihrig@gmail.com>2022-06-15 09:52:28 -0400
commitb2109a12aa84b5006616a3e82cb26acf53c23e81 (patch)
treef454d0db7fe18edeb8ac91e39cc3afd78f91292a /cli/tests/testdata
parenteadf943e594a5ebf95ddf7e007cfb7d2dcff130e (diff)
fix(url): properly indent when inspecting URLs (#14867)
This commit updates the custom inspect function for URL objects to pass the inspect options through so that the context is propagated and the resulting indentation is correct. Fixes: https://github.com/denoland/deno/issues/14171
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/custom_inspect_url.js3
-rw-r--r--cli/tests/testdata/custom_inspect_url.js.out47
2 files changed, 50 insertions, 0 deletions
diff --git a/cli/tests/testdata/custom_inspect_url.js b/cli/tests/testdata/custom_inspect_url.js
new file mode 100644
index 000000000..69aa2dc49
--- /dev/null
+++ b/cli/tests/testdata/custom_inspect_url.js
@@ -0,0 +1,3 @@
+console.log([new URL("https://example.com/path")]);
+console.log({ url: new URL("https://example.com/path") });
+console.log({ url: [new URL("https://example.com/path")] });
diff --git a/cli/tests/testdata/custom_inspect_url.js.out b/cli/tests/testdata/custom_inspect_url.js.out
new file mode 100644
index 000000000..1c714e34e
--- /dev/null
+++ b/cli/tests/testdata/custom_inspect_url.js.out
@@ -0,0 +1,47 @@
+[
+ URL {
+ href: "https://example.com/path",
+ origin: "https://example.com",
+ protocol: "https:",
+ username: "",
+ password: "",
+ host: "example.com",
+ hostname: "example.com",
+ port: "",
+ pathname: "/path",
+ hash: "",
+ search: ""
+ }
+]
+{
+ url: URL {
+ href: "https://example.com/path",
+ origin: "https://example.com",
+ protocol: "https:",
+ username: "",
+ password: "",
+ host: "example.com",
+ hostname: "example.com",
+ port: "",
+ pathname: "/path",
+ hash: "",
+ search: ""
+ }
+}
+{
+ url: [
+ URL {
+ href: "https://example.com/path",
+ origin: "https://example.com",
+ protocol: "https:",
+ username: "",
+ password: "",
+ host: "example.com",
+ hostname: "example.com",
+ port: "",
+ pathname: "/path",
+ hash: "",
+ search: ""
+ }
+ ]
+}