Skip to content

Commit

Permalink
Improved "expected fail" messages for web platform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss authored and domenic committed Jan 19, 2020
1 parent e2dbad8 commit 16c9856
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/web-platform-tests/run-wpts.js
Expand Up @@ -21,9 +21,10 @@ const validReasons = new Set([
"needs-canvas"
]);

const hasNode10 = Number(process.versions.node.split(".")[0]) >= 10;
const hasNode11 = Number(process.versions.node.split(".")[0]) >= 11;
const hasNode12 = Number(process.versions.node.split(".")[0]) >= 12;
const nodeMajor = Number(process.versions.node.split(".")[0]);
const hasNode10 = nodeMajor >= 10;
const hasNode11 = nodeMajor >= 11;
const hasNode12 = nodeMajor >= 12;
const hasCanvas = Boolean(Canvas);

const manifestFilename = path.resolve(__dirname, "wpt-manifest.json");
Expand Down Expand Up @@ -69,7 +70,8 @@ describe("web-platform-tests", () => {
if (matchingPattern && shouldSkip) {
specify.skip(`[${reason}] ${testFile}`);
} else if (expectFail) {
runSingleWPT(testFilePath, `[expected fail] ${testFile}`, expectFail);
const failReason = reason !== "fail" ? `: ${reason}` : "";
runSingleWPT(testFilePath, `[expected fail${failReason}] ${testFile}`, expectFail);
} else {
runSingleWPT(testFilePath, testFile, expectFail);
}
Expand Down

0 comments on commit 16c9856

Please sign in to comment.