I'm using jest 4.2.4 with my React 16.13.0 application. I have set up this type of mock ...
jest.spyOn(ReduxFirebase, "getFirebase").mockReturnValue({
firestore: jest.fn(() => ({ collection: jest.fn(() => collection) })),
});
How do I clear this between tests? I tried this ...
describe("User", () => {
afterEach(() => {
jest.clearAllMocks();
});
but it is not working. Setting this later in the test suite
jest.spyOn(ReduxFirebase, "getFirebase").mockReturnValue({
firestore: jest.fn(() => ({ collection: jest.fn(() => collection2) })),
});
does not take (the original spy is still in place.