From 0ad5c30832f1f42b560249a4fcd200d948848cb4 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Sun, 3 Mar 2024 05:27:48 +0100 Subject: [PATCH] chore: remove import-fresh as devDependency --- package.json | 1 - test/node-test/agent.js | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bc1d2f6520c..0062ec9f59d 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 c077fbab4e8..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,8 +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()) }) - -after(() => process.exit())