Open bwhrsc opened 4 years ago
Solved - https://stackoverflow.com/questions/62566957/cannot-call-firestore-from-unit-tests/62586875#62586875 This still feels like a workaround, and not sure what the origin of the problem is, so leaving this open
Sorry for the late response here, are you still having issue with this?
Looking at your code I'm not sure if your test is talking to the emulator. You can follow the steps here to make sure your tests talk to the emulator instead of an actual firestore instance. https://firebase.google.com/docs/emulator-suite/connect_firestore#admin_sdks
Developing Google cloud functions locally. Trying to test functions that invoke Firestore. Here is a minimal example.
functions/index.js:
functions/test/index.test.js:
Starting jest from functions folder:
(Among other test-related output):
Environment: