aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/url.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js/url.test.ts')
-rw-r--r--test/bun.js/url.test.ts62
1 files changed, 60 insertions, 2 deletions
diff --git a/test/bun.js/url.test.ts b/test/bun.js/url.test.ts
index 96640c1f9..19e10b262 100644
--- a/test/bun.js/url.test.ts
+++ b/test/bun.js/url.test.ts
@@ -2,13 +2,71 @@ import { describe, it, expect } from "bun:test";
describe("url", () => {
it("prints", () => {
- expect(Bun.inspect(new URL("https://example.com"))).toBe("https://example.com/");
+ expect(Bun.inspect(new URL("https://example.com"))).toBe(`URL {
+ href: "https://example.com/",
+ origin: "https://example.com",
+ protocol: "https:",
+ username: "",
+ password: "",
+ host: "example.com",
+ hostname: "example.com",
+ port: "",
+ pathname: "/",
+ hash: "",
+ search: "",
+ searchParams: URLSearchParams {
+ append: [Function: append],
+ delete: [Function: delete],
+ get: [Function: get],
+ getAll: [Function: getAll],
+ has: [Function: has],
+ set: [Function: set],
+ sort: [Function: sort],
+ entries: [Function: entries],
+ keys: [Function: keys],
+ values: [Function: values],
+ forEach: [Function: forEach],
+ toString: [Function: toString],
+ [Symbol(Symbol.iterator)]: [Function: entries]
+ },
+ toJSON: [Function: toJSON],
+ toString: [Function: toString]
+}`);
expect(
Bun.inspect(
new URL("https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"),
),
- ).toBe("https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night");
+ ).toBe(`URL {
+ href: "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night",
+ origin: "https://github.com",
+ protocol: "https:",
+ username: "",
+ password: "",
+ host: "github.com",
+ hostname: "github.com",
+ port: "",
+ pathname: "/oven-sh/bun/issues/135",
+ hash: "",
+ search: "?hello%20i%20have%20spaces%20thank%20you%20good%20night",
+ searchParams: URLSearchParams {
+ append: [Function: append],
+ delete: [Function: delete],
+ get: [Function: get],
+ getAll: [Function: getAll],
+ has: [Function: has],
+ set: [Function: set],
+ sort: [Function: sort],
+ entries: [Function: entries],
+ keys: [Function: keys],
+ values: [Function: values],
+ forEach: [Function: forEach],
+ toString: [Function: toString],
+ [Symbol(Symbol.iterator)]: [Function: entries]
+ },
+ toJSON: [Function: toJSON],
+ toString: [Function: toString]
+}`);
});
it("works", () => {
const inputs = [