diff --git a/packages/core/__tests__/core.test.ts b/packages/core/__tests__/core.test.ts index 09bc587b..4371924a 100644 --- a/packages/core/__tests__/core.test.ts +++ b/packages/core/__tests__/core.test.ts @@ -670,7 +670,12 @@ describe('oidc-client-tests', () => { it('HTTP get request to get token endpoint', async () => { const http = new HttpClient('actions/oidc-client') - const res = await http.get(getTokenEndPoint()) - expect(res.message.statusCode).toBe(200) + try { + const res = await http.get(getTokenEndPoint()) + expect(res.message.statusCode).toBe(200) + } + finally { + http.dispose() + } }) }) diff --git a/packages/http-client/__tests__/auth.test.ts b/packages/http-client/__tests__/auth.test.ts index 50d0a6a4..1bfa8e95 100644 --- a/packages/http-client/__tests__/auth.test.ts +++ b/packages/http-client/__tests__/auth.test.ts @@ -59,6 +59,7 @@ describe('auth', () => { const http: httpm.HttpClient = new httpm.HttpClient('http-client-tests', [ ph ]) + try { const res: httpm.HttpClientResponse = await http.get( 'http://postman-echo.com/get' ) @@ -68,5 +69,9 @@ describe('auth', () => { const auth: string = obj.headers.authorization expect(auth).toBe(`Bearer ${token}`) expect(obj.url).toBe('http://postman-echo.com/get') + } + finally { + http.dispose() + } }) })