Skip to content

Commit

Permalink
chore: remove import-fresh as devDependency (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Mar 3, 2024
1 parent 3608e61 commit b4ebda2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions test/node-test/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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())
})

0 comments on commit b4ebda2

Please sign in to comment.