diff --git a/package.json b/package.json index d71bac7a179..8fdfd7a4bc4 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,6 @@ "formdata-node": "^6.0.3", "https-pem": "^3.0.0", "husky": "^9.0.7", - "import-fresh": "^3.3.0", "jest": "^29.0.2", "jsdom": "^24.0.0", "jsfuzz": "^1.0.15", diff --git a/test/node-test/agent.js b/test/node-test/agent.js index 91dd99e9bf7..74a3ae26e77 100644 --- a/test/node-test/agent.js +++ b/test/node-test/agent.js @@ -15,7 +15,6 @@ const { setGlobalDispatcher, getGlobalDispatcher } = require('../..') -const importFresh = require('import-fresh') const { tspl } = require('@matteo.collina/tspl') const { closeServerAsPromise } = require('../utils/node-http') @@ -805,6 +804,10 @@ test('connect is not valid', t => { test('the dispatcher is truly global', t => { const agent = getGlobalDispatcher() - const undiciFresh = importFresh('../../index.js') + assert.ok(require.resolve('../../index.js') in require.cache) + delete require.cache[require.resolve('../../index.js')] + assert.strictEqual(require.resolve('../../index.js') in require.cache, false) + const undiciFresh = require('../../index.js') + assert.ok(require.resolve('../../index.js') in require.cache) assert.strictEqual(agent, undiciFresh.getGlobalDispatcher()) })