Skip to content

Commit 4a7f244

Browse files
committed
Clean up some pre-Node v14 support code
This was missed in 6c1f058.
1 parent e8f7ca8 commit 4a7f244

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

lib/jsdom/living/helpers/http-request.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ const ver = process.version.replace("v", "").split(".");
88
const majorNodeVersion = Number.parseInt(ver[0]);
99

1010
function abortRequest(clientRequest) {
11-
// clientRequest.destroy breaks the test suite for versions 10 and 12,
12-
// hence the version check
13-
if (majorNodeVersion > 13) {
14-
clientRequest.destroy();
15-
} else {
16-
clientRequest.abort();
17-
}
11+
clientRequest.destroy();
1812
clientRequest.removeAllListeners();
1913
clientRequest.on("error", () => {});
2014
}

test/web-platform-tests/run-wpts.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const { resolveReason } = require("./utils.js");
1010

1111
const validInnerReasons = new Set([
1212
"fail",
13-
"fail-with-canvas",
14-
"needs-node14"
13+
"fail-with-canvas"
1514
]);
1615

1716
const validReasons = new Set([
@@ -20,7 +19,6 @@ const validReasons = new Set([
2019
"fail-with-canvas",
2120
"timeout",
2221
"flaky",
23-
"needs-node14",
2422
"needs-canvas"
2523
]);
2624

test/web-platform-tests/to-run.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ EventListener-incumbent-global-1.sub.html: [timeout, Multi-globals]
196196
EventListener-incumbent-global-2.sub.html: [timeout, Multi-globals]
197197
EventListener-invoke-legacy.html: [timeout, Animation stuff not implemented]
198198
EventTarget-dispatchEvent.html: [fail, We don't support every event interface yet]
199-
KeyEvent-initKeyEvent.html: [needs-node14, Test uses optional chaining]
200199
event-global-extra.window.html: [fail, We're supposed to check the event listener's global (not the Event's global)]
201200
relatedTarget.window.html: [fail, Unknown]
202201
webkit-animation-end-event.html: [fail, WebKit-prefixed events not implemented]

test/web-platform-tests/utils.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"use strict";
22
const { Canvas } = require("../../lib/jsdom/utils.js");
33

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

86
exports.resolveReason = reason => {
@@ -12,8 +10,7 @@ exports.resolveReason = reason => {
1210
}
1311

1412
if (reason === "fail" ||
15-
(reason === "fail-with-canvas" && hasCanvas) ||
16-
(reason === "needs-node14" && !hasNode14)) {
13+
(reason === "fail-with-canvas" && hasCanvas)) {
1714
return "expect-fail";
1815
}
1916

0 commit comments

Comments
 (0)