diff --git a/package.json b/package.json index cd2e3c18..543f3065 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "mime-types": "^2.1.35", "qs": "^6.15.0", "type-fest": "^4.41.0", - "undici": "^7.24.0", + "undici": "^8.0.0", "ylru": "^2.0.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2faba1f..44eecf78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,8 +28,8 @@ importers: specifier: ^4.41.0 version: 4.41.0 undici: - specifier: ^7.24.0 - version: 7.24.6 + specifier: ^8.0.0 + version: 8.0.1 ylru: specifier: ^2.0.0 version: 2.0.0 @@ -1560,9 +1560,9 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - undici@7.24.6: - resolution: {integrity: sha512-Xi4agocCbRzt0yYMZGMA6ApD7gvtUFaxm4ZmeacWI4cZxaF6C+8I8QfofC20NAePiB/IcvZmzkJ7XPa471AEtA==} - engines: {node: '>=20.18.1'} + undici@8.0.1: + resolution: {integrity: sha512-6qdTUr+jabXmYKeYkv/+pIvO7d0bs1k9uy+5PFnXr4segNVwILH1KExhwRh3/iGa6gSLmySK3hTnSs3k7ZPnjQ==} + engines: {node: '>=22.19.0'} unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} @@ -2871,7 +2871,7 @@ snapshots: undici-types@6.21.0: {} - undici@7.24.6: {} + undici@8.0.1: {} unicode-emoji-modifier-base@1.0.0: {} diff --git a/test/options.dispatcher.test.ts b/test/options.dispatcher.test.ts index e737afc0..18b7b4da 100644 --- a/test/options.dispatcher.test.ts +++ b/test/options.dispatcher.test.ts @@ -27,6 +27,7 @@ describe('options.dispatcher.test.ts', () => { afterAll(async () => { await close(); + proxyServer.closeAllConnections(); await new Promise((resolve) => { proxyServer.close(resolve); }); @@ -50,6 +51,7 @@ describe('options.dispatcher.test.ts', () => { // console.log(response2.status, response2.headers); assert.equal(response2.status, 200); assert.equal(response2.data.name, 'urllib'); + await proxyAgent.close(); }); it('should work with getGlobalDispatcher() dispatcher', async () => { @@ -63,6 +65,7 @@ describe('options.dispatcher.test.ts', () => { assert.equal(response.status, 200); assert.equal(response.data, '

hello

'); setGlobalDispatcher(agent); + await proxyAgent.close(); }); it('should work with http/2 dispatcher', async () => { @@ -80,5 +83,6 @@ describe('options.dispatcher.test.ts', () => { }); assert.equal(response.status, 200); assert.match(response.headers['content-type'] ?? '', /application\/json/); + await agent.close(); }); });