diff --git a/tools/wpt.ts b/tools/wpt.ts index 2b61682be7..a216e84b0d 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -249,8 +249,10 @@ async function generateWptReport( if (!case_.passed) { if (typeof test.expectation === "boolean") { expected = test.expectation ? "PASS" : "FAIL"; - } else { + } else if (Array.isArray(test.expectation)) { expected = test.expectation.includes(case_.name) ? "FAIL" : "PASS"; + } else { + expected = "PASS"; } } @@ -708,10 +710,12 @@ function discoverTestsToRun( } } - assert( - Array.isArray(expectation) || typeof expectation == "boolean", - "test entry must not have a folder expectation", - ); + if (!noIgnore) { + assert( + Array.isArray(expectation) || typeof expectation == "boolean", + "test entry must not have a folder expectation", + ); + } if ( filter && diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts index 1752dab041..8aa27a6647 100644 --- a/tools/wpt/utils.ts +++ b/tools/wpt/utils.ts @@ -98,6 +98,7 @@ export function getExpectFailForCase( expectation: boolean | string[], caseName: string, ): boolean { + if (noIgnore) return false; if (typeof expectation == "boolean") { return !expectation; }