From 7e36c5333dac689acee1f85da6e656375bba4445 Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:04:03 -0500 Subject: [PATCH] test: skip node-fetch and @whatwg-node/fetch tests on Node 21+ --- testbed/basic/ci.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testbed/basic/ci.test.ts b/testbed/basic/ci.test.ts index 59ebcaa5..a5a2cde2 100644 --- a/testbed/basic/ci.test.ts +++ b/testbed/basic/ci.test.ts @@ -58,14 +58,17 @@ if (process.env.CI === "true") { platform: "node", command: "node --experimental-fetch entry-node-native-fetch.js", }, - { + // The --no-experimental-fetch flag is only available on Node 20 and below. Since node-fetch and + // @whatwg-node/fetch are only used when native fetch is not available, we can skip them on Node + // 21 and above. + nodeVersionMajor < 21 && { name: "Node with node-fetch", platform: "node", command: `node ${noFetchFlag} entry-node.js`, skipCryptoTest: nodeVersionMajor < 16, skipMultipartTest: true, // node-fetch doesn't support streaming request bodies }, - { + nodeVersionMajor < 21 && { name: "Node with @whatwg-node/fetch", platform: "node", command: `node ${noFetchFlag} entry-node-whatwg.js`,