Skip to content

Commit

Permalink
Update tests for new way of testing bad base URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed May 14, 2018
1 parent 1d5b571 commit 949896c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/get-latest-platform-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ process.on("unhandledRejection", err => {
// 1. Go to https://github.com/w3c/web-platform-tests/tree/master/url
// 2. Press "y" on your keyboard to get a permalink
// 3. Copy the commit hash
const commitHash = "0050cfbe145bc9c24981186fa47e714147c1674d";
const commitHash = "d99193c80fc1d52f5a33bf8e8de7e7363a6bfa20";

// Have to use RawGit as JSDOM.fromURL checks Content-Type header.
const urlPrefix = `https://rawgit.com/w3c/web-platform-tests/${commitHash}/url/`;
Expand Down
16 changes: 16 additions & 0 deletions test/web-platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,22 @@ describe("Web platform tests", () => {
}
});

describe("bad base URL", () => {
for (const rawExpected of parsingTestCases) {
if (typeof rawExpected === "string" || !rawExpected.failure) {
continue;
}

const expected = {
input: "about:blank",
base: rawExpected.input,
failure: true
};

test(`<${expected.input}> against <${expected.base}>`, testURL(expected));
}
});

describe("setters", () => {
for (const key of Object.keys(setterTestData)) {
if (key === "comment") {
Expand Down

0 comments on commit 949896c

Please sign in to comment.