You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using axios-mock-adapter in jest I somehow receive this error after the test passed. It seems like that the mock adapter is working and returns the correct result, but somehow the real http request is somehow executed in the background?
importaxiosfrom'axios'importMockAdapterfrom'axios-mock-adapter'constuserSoeren: User={id: 42,name: 'Sören'}test('single client request is executed',async()=>{constaxiosInstance=axios.create()constaxiosInstanceMock=newMockAdapter(axiosInstance)axiosInstanceMock.onGet('/api/users').reply(StatusCodes.OK,[userSoeren])constresult=awaitaxiosInstance.get('/api/users')console.log(result)expect(result.data).toEqual<User[]>([userSoeren])})
When using
axios-mock-adapter
in jest I somehow receive this error after the test passed. It seems like that the mock adapter is working and returns the correct result, but somehow the real http request is somehow executed in the background?I've installed
[email protected]
and[email protected]
.Might this be related to #338 ?
The text was updated successfully, but these errors were encountered: