test: Fix socket hang up in node-fetch 3.3.2 fails tests (#10443)

This commit is contained in:
Manuel
2026-04-17 01:39:53 +01:00
committed by GitHub
parent f303f752c6
commit fc53270dbe
3 changed files with 15 additions and 3 deletions
+5 -1
View File
@@ -2,7 +2,11 @@
const http = require('http');
const express = require('express');
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
const fetch = (...args) =>
import('node-fetch').then(({ default: fetch }) => {
const [url, options = {}] = args;
return fetch(url, { agent: new http.Agent({ keepAlive: false }), ...options });
});
require('./helper');
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
+5 -1
View File
@@ -1,7 +1,11 @@
const http = require('http');
const express = require('express');
const req = require('../lib/request');
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
const fetch = (...args) =>
import('node-fetch').then(({ default: fetch }) => {
const [url, options = {}] = args;
return fetch(url, { agent: new http.Agent({ keepAlive: false }), ...options });
});
const FormData = require('form-data');
require('./helper');
const { updateCLP } = require('./support/dev');
+5 -1
View File
@@ -1,6 +1,10 @@
const http = require('http');
const express = require('express');
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
const fetch = (...args) =>
import('node-fetch').then(({ default: fetch }) => {
const [url, options = {}] = args;
return fetch(url, { agent: new http.Agent({ keepAlive: false }), ...options });
});
const ws = require('ws');
const request = require('../lib/request');
const Config = require('../lib/Config');