in my testcase, i rendered a react component called AdLog, which will do axios query in componentDidMount.
i have wrote several testcases,
Should render agent log success => not dealing with the response
Should render m log success' => not dealing with the response
Should render log table success => using axios-mock-adapter to mock the response.
the test result is failing due to axios.post will throw exception(e is undefined).
if i remove testcase 1 & 2, or add mockAxios.onAny().reply(200, adData) in testcase 1 & 2, then the file test will pass.
looks like the request in testcase 1 & 2 are pending, and somehow fired in the 3th case.
I've checked the reset function, it will clean resetHandlers and resetHistory correctly.
in my testcase, i rendered a react component called AdLog, which will do axios query in componentDidMount.
i have wrote several testcases,
the test result is failing due to axios.post will throw exception(e is undefined).
if i remove testcase 1 & 2, or add
mockAxios.onAny().reply(200, adData)
in testcase 1 & 2, then the file test will pass.looks like the request in testcase 1 & 2 are pending, and somehow fired in the 3th case.
I've checked the
reset
function, it will clean resetHandlers and resetHistory correctly.i got confused, is it a bug ?