Replies: 1 comment 2 replies
-
Might be worth double-checking how you're importing the firestore function (since the import isn't shown in your sample code). Your mock defines 'firestore' as a property on an object, but returns the object as the module reference, so if your import doesn't destructure it you'll be trying to call the object instead of the function. If the imported module reference is itself meant to be callable, you'll need to refactor your mock so it returns a function instead of an object. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to test the library methods with JEST? Like `firestore()``
I'm going crazy trying to test methods like collections, but I can't test it, could someone help me please?
This is the method that checks within the user collection if the number passed exists.
I tried to mock like:
Beta Was this translation helpful? Give feedback.
All reactions