From e3b060122897b606ce4c685fc50dcf17a603acb3 Mon Sep 17 00:00:00 2001 From: Tatyana Kostromskaya <32135588+takost@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:43:51 +0000 Subject: [PATCH] test --- packages/core/__tests__/core.test.ts | 9 +++++++-- packages/http-client/__tests__/auth.test.ts | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) 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() + } }) })