fix(tests): close sockets to remove a Jest warning about resources outliving their tests
This commit is contained in:
@@ -677,5 +677,8 @@ describe('oidc-client-tests', () => {
|
|||||||
const http = new HttpClient('actions/oidc-client')
|
const http = new HttpClient('actions/oidc-client')
|
||||||
const res = await http.get(getTokenEndPoint())
|
const res = await http.get(getTokenEndPoint())
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
|
// Consume the response to close the socket
|
||||||
|
await res.readBody()
|
||||||
|
res.message.destroy()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ describe('basics', () => {
|
|||||||
'https://postman-echo.com/get'
|
'https://postman-echo.com/get'
|
||||||
)
|
)
|
||||||
expect(res.message.statusCode).toBe(200)
|
expect(res.message.statusCode).toBe(200)
|
||||||
|
// Consume the response to close the socket
|
||||||
|
res.message.destroy()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('does basic http delete request', async () => {
|
it('does basic http delete request', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user