From d7a5aed5114f3ffd27221ae97bc57f453410427e Mon Sep 17 00:00:00 2001 From: Sven Nicolai Viig Date: Thu, 31 Oct 2019 19:55:54 +0100 Subject: Adds custom inspect method for URL (#3241) --- cli/js/url_test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cli/js/url_test.ts') diff --git a/cli/js/url_test.ts b/cli/js/url_test.ts index 07a8028ce..23f9f5f4b 100644 --- a/cli/js/url_test.ts +++ b/cli/js/url_test.ts @@ -179,3 +179,11 @@ test(function sortingNonExistentParamRemovesQuestionMarkFromURL(): void { assertEquals(url.href, "http://example.com/"); assertEquals(url.search, ""); }); + +test(function customInspectFunction(): void { + const url = new URL("http://example.com/?"); + assertEquals( + Deno.inspect(url), + 'URL { href: "http://example.com/?", origin: "http://example.com", protocol: "http:", username: "", password: "", host: "example.com", hostname: "example.com", port: "", pathname: "/", hash: "", search: "?" }' + ); +}); -- cgit v1.2.3