mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Adds custom inspect method for URL (#3241)
This commit is contained in:
parent
4f8c936974
commit
d7a5aed511
2 changed files with 29 additions and 0 deletions
|
@ -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: "?" }'
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue