DEV Community

Discussion on: I wrote a JavaScript Unit Test today... Spy On An Import Time Dependency

Collapse
 
tahaazzabi profile image
taha azzabi • Edited

Thank you for this awesome example of using Jest to mock Firebase.
in the Test #2 since you've mocked a module with jest.mock('firebase')
i dont think that we need to call those two lines:
let mockInitializeApp = jest.fn();
firebase.initializeApp = mockInitializeApp;

since jest.mock will automatically set all exports of a module to the Mock Function