Skip to content

Commit

Permalink
Clean up some pre-Node v14 support code
Browse files Browse the repository at this point in the history
This was missed in 6c1f058.
  • Loading branch information
domenic committed Jan 7, 2023
1 parent e8f7ca8 commit 4a7f244
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
8 changes: 1 addition & 7 deletions lib/jsdom/living/helpers/http-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ const ver = process.version.replace("v", "").split(".");
const majorNodeVersion = Number.parseInt(ver[0]);

function abortRequest(clientRequest) {
// clientRequest.destroy breaks the test suite for versions 10 and 12,
// hence the version check
if (majorNodeVersion > 13) {
clientRequest.destroy();
} else {
clientRequest.abort();
}
clientRequest.destroy();
clientRequest.removeAllListeners();
clientRequest.on("error", () => {});
}
Expand Down
4 changes: 1 addition & 3 deletions test/web-platform-tests/run-wpts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const { resolveReason } = require("./utils.js");

const validInnerReasons = new Set([
"fail",
"fail-with-canvas",
"needs-node14"
"fail-with-canvas"
]);

const validReasons = new Set([
Expand All @@ -20,7 +19,6 @@ const validReasons = new Set([
"fail-with-canvas",
"timeout",
"flaky",
"needs-node14",
"needs-canvas"
]);

Expand Down
1 change: 0 additions & 1 deletion test/web-platform-tests/to-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ EventListener-incumbent-global-1.sub.html: [timeout, Multi-globals]
EventListener-incumbent-global-2.sub.html: [timeout, Multi-globals]
EventListener-invoke-legacy.html: [timeout, Animation stuff not implemented]
EventTarget-dispatchEvent.html: [fail, We don't support every event interface yet]
KeyEvent-initKeyEvent.html: [needs-node14, Test uses optional chaining]
event-global-extra.window.html: [fail, We're supposed to check the event listener's global (not the Event's global)]
relatedTarget.window.html: [fail, Unknown]
webkit-animation-end-event.html: [fail, WebKit-prefixed events not implemented]
Expand Down
5 changes: 1 addition & 4 deletions test/web-platform-tests/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use strict";
const { Canvas } = require("../../lib/jsdom/utils.js");

const nodeMajor = Number(process.versions.node.split(".", 1)[0]);
const hasNode14 = nodeMajor >= 14;
const hasCanvas = Boolean(Canvas);

exports.resolveReason = reason => {
Expand All @@ -12,8 +10,7 @@ exports.resolveReason = reason => {
}

if (reason === "fail" ||
(reason === "fail-with-canvas" && hasCanvas) ||
(reason === "needs-node14" && !hasNode14)) {
(reason === "fail-with-canvas" && hasCanvas)) {
return "expect-fail";
}

Expand Down

0 comments on commit 4a7f244

Please sign in to comment.