mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
chore: update wpt suite (#24070)
This commit is contained in:
parent
38ff9faff6
commit
f8fdaa082b
5 changed files with 3058 additions and 474 deletions
File diff suppressed because it is too large
Load diff
|
@ -196,7 +196,7 @@ async function generateBundle(location: URL): Promise<string> {
|
|||
const doc = new DOMParser().parseFromString(body, "text/html");
|
||||
assert(doc, "document should have been parsed");
|
||||
const scripts = doc.getElementsByTagName("script");
|
||||
const title = doc.getElementsByTagName("title")[0]?.childNodes[0].nodeValue;
|
||||
const title = doc.getElementsByTagName("title")[0]?.childNodes[0]?.nodeValue;
|
||||
const scriptContents = [];
|
||||
let inlineScriptCount = 0;
|
||||
if (title) {
|
||||
|
|
|
@ -79,7 +79,7 @@ export function getManifest(): Manifest {
|
|||
const EXPECTATION_PATH = join(ROOT_PATH, "./tests/wpt/runner/expectation.json");
|
||||
|
||||
export interface Expectation {
|
||||
[key: string]: Expectation | boolean | string[];
|
||||
[key: string]: Expectation | boolean | string[] | { ignore: boolean };
|
||||
}
|
||||
|
||||
export function getExpectation(): Expectation {
|
||||
|
@ -90,7 +90,7 @@ export function getExpectation(): Expectation {
|
|||
export function saveExpectation(expectation: Expectation) {
|
||||
Deno.writeTextFileSync(
|
||||
EXPECTATION_PATH,
|
||||
JSON.stringify(expectation, undefined, " "),
|
||||
JSON.stringify(expectation, undefined, " ") + "\n",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ export function getExpectFailForCase(
|
|||
caseName: string,
|
||||
): boolean {
|
||||
if (noIgnore) return false;
|
||||
if (typeof expectation == "boolean") {
|
||||
if (typeof expectation === "boolean") {
|
||||
return !expectation;
|
||||
}
|
||||
return expectation.includes(caseName);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit abcbb64783af5b776a3c5f4e13cf4d8756217830
|
||||
Subproject commit a14e908e1fd7c6e848ef60df044af1c040a012d2
|
|
@ -246,12 +246,12 @@ async function run() {
|
|||
};
|
||||
minifiedResults.push(minified);
|
||||
}
|
||||
await Deno.writeTextFile(json, JSON.stringify(minifiedResults));
|
||||
await Deno.writeTextFile(json, JSON.stringify(minifiedResults) + "\n");
|
||||
}
|
||||
|
||||
if (wptreport) {
|
||||
const report = await generateWptReport(results, startTime, endTime);
|
||||
await Deno.writeTextFile(wptreport, JSON.stringify(report));
|
||||
await Deno.writeTextFile(wptreport, JSON.stringify(report) + "\n");
|
||||
}
|
||||
|
||||
const code = reportFinal(results, endTime - startTime);
|
||||
|
@ -385,7 +385,7 @@ async function update() {
|
|||
const endTime = new Date().getTime();
|
||||
|
||||
if (json) {
|
||||
await Deno.writeTextFile(json, JSON.stringify(results));
|
||||
await Deno.writeTextFile(json, JSON.stringify(results) + "\n");
|
||||
}
|
||||
|
||||
const resultTests: Record<
|
||||
|
@ -447,7 +447,7 @@ function insertExpectation(
|
|||
assert(segment, "segments array must never be empty");
|
||||
if (segments.length > 0) {
|
||||
if (
|
||||
!currentExpectation[segment] ||
|
||||
currentExpectation[segment] === undefined ||
|
||||
Array.isArray(currentExpectation[segment]) ||
|
||||
typeof currentExpectation[segment] === "boolean"
|
||||
) {
|
||||
|
@ -459,7 +459,14 @@ function insertExpectation(
|
|||
finalExpectation,
|
||||
);
|
||||
} else {
|
||||
currentExpectation[segment] = finalExpectation;
|
||||
if (
|
||||
currentExpectation[segment] === undefined ||
|
||||
Array.isArray(currentExpectation[segment]) ||
|
||||
typeof currentExpectation[segment] === "boolean" ||
|
||||
(currentExpectation[segment] as { ignore: boolean })?.ignore !== true
|
||||
) {
|
||||
currentExpectation[segment] = finalExpectation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue