Clearing/resetting/restoring Jest mocks
I am never gonna remember this correctly I guess. 🤷
jest.clearAllMocks()
only clears the internal state of the mockjest.resetAllMocks()
does the same + it removes any mocked implementations or return valuesjest.restoreAllMocks()
does everything above but it restores the original non-mocked implementation (and works only withjest.spyOn
)