Closed gwuah closed 4 years ago
Could you give an example of the issue you're facing?
I can't even reproduce the issue but i was able to make headway by going through this pr https://github.com/ctimmerm/axios-mock-adapter/issues/116.
Incase anyone faces this same issue,
mock.reset()
after every test case.I am facing exactly the same issue- I even have it like this
` let axiosMock: MockAdapter;
beforeEach(() => { axiosMock = new MockAdapter(axios); });
afterEach(() => { axiosMock.restore(); });`
and I use replyOnce
but which ever test is first in execution order it takes "advantage" and then the next one that's mocking same url but negative case simply ignores it- I even tried having reset
and restore
within the test itself.
I don't know if there's some caching functionality in this library but new mocks are not working. It only returns the previous mock value. Any help?