Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: pattern test
  • Loading branch information
triniwiz committed Feb 12, 2025
commit c7213590729a1ae3b2cabff02f06170c5bd9f990
8 changes: 4 additions & 4 deletions TestRunner/app/tests/URLPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe("URLPattern", function () {
it("throws on invalid URLPattern", function () {
var exceptionCaught = false;
try {
const pattern = new URLPattern(null);
const pattern = new URLPattern(1);
} catch (e) {
exceptionCaught = true;
}
Expand All @@ -22,7 +22,7 @@ describe("URLPattern", function () {

it("parses simple pattern", function () {
const pattern = new URLPattern("https://example.com/books/:id");
expect(pattern.protocol).toBe("https:");
expect(pattern.protocol).toBe("https");
expect(pattern.hostname).toBe("example.com");
expect(pattern.pathname).toBe("/books/:id");
expect(pattern.port).toBe("");
Expand All @@ -36,13 +36,13 @@ describe("URLPattern", function () {

it("parses with undefined base", function () {
const pattern = new URLPattern("https://google.com", undefined);
expect(pattern.protocol).toBe("https:");
expect(pattern.protocol).toBe("https");
expect(pattern.hostname).toBe("google.com");
});

it("parses with null base", function () {
const pattern = new URLPattern("https://google.com", null);
expect(pattern.protocol).toBe("https:");
expect(pattern.protocol).toBe("https");
expect(pattern.hostname).toBe("google.com");
});

Expand Down
Loading