hattipjs / hattip

Like Express, but for the future
MIT License
1.28k stars 18 forks source link

test: skip node-fetch and @whatwg-node/fetch tests on Node 21+ #187

Open aleclarson opened 1 week ago

aleclarson commented 1 week ago

The --no-experimental-fetch flag was removed in Node 21: https://github.com/nodejs/node/pull/52611

When native fetch exists, node-fetch and @whatwg-node/fetch polyfills are not used. So in Node 21+, the integration tests for those polyfills are simply testing native fetch.

Therefore, we can skip the integration tests for the node-fetch and @whatwg-node/fetch polyfills when the Node major version is 21 or higher.

aleclarson commented 1 week ago

CI failure appears to be unrelated to this PR

cyco130 commented 3 days ago

I want to remove those entry points anyway. It shouldn't be Hattip's responsibility to polyfill fetch anymore (it made sense back in Node 14/16 days).