Jest — mockReset for afterEach affect toHaveBeenCalledTimes
Problem
I used Jest to mock the function for unit test on the nodeJS application. I ran into a situation that the toHaveBeenCalledTimes actual value not correct for the second ‘it’ test case. The…