diff options
author | 2022-09-16 16:45:26 -0700 | |
---|---|---|
committer | 2022-09-16 16:45:26 -0700 | |
commit | f55b9a853064f276c918fe3f91df55c48f901f86 (patch) | |
tree | 116eb307fa1d6c055cc613e1700c7f3228a7159b /test/bun.js/web-globals.test.js | |
parent | da6f954e0dd851af4ad206de74fbcd500d3712e6 (diff) | |
download | bun-f55b9a853064f276c918fe3f91df55c48f901f86.tar.gz bun-f55b9a853064f276c918fe3f91df55c48f901f86.tar.zst bun-f55b9a853064f276c918fe3f91df55c48f901f86.zip |
Fix `origin` missing `protocol` in `URL`
Fixes https://github.com/oven-sh/bun/issues/1244
Diffstat (limited to 'test/bun.js/web-globals.test.js')
-rw-r--r-- | test/bun.js/web-globals.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bun.js/web-globals.test.js b/test/bun.js/web-globals.test.js index c5740b0fc..70c2f01e5 100644 --- a/test/bun.js/web-globals.test.js +++ b/test/bun.js/web-globals.test.js @@ -96,3 +96,12 @@ it("crypto.randomUUID", () => { expect(uuid2[23]).toBe("-"); } }); + +it("URL.prototype.origin", () => { + const url = new URL("https://html.spec.whatwg.org/"); + const { origin, host, hostname } = url; + + expect(hostname).toBe("html.spec.whatwg.org"); + expect(host).toBe("html.spec.whatwg.org"); + expect(origin).toBe("https://html.spec.whatwg.org"); +}); |