I am mocking Date.now()
implementation returning a specific date however, after the test is done the afterAll
+ mockRestore()
doesn't quite rid of the mock.
When I run another test the date now is still mocked to 1626764400000. Is there a different function I have to use to reset the mock? I have already used: mockReset
, mockClear
, jest.clearAllMocks
.
beforeAll((): void => {
jest.spyOn(Date, 'now').mockImplementation(() => 1626764400000);
});
afterAll((): void => {
jest.clearAllMocks();
jest.spyOn(Date, 'now').mockRestore();
});