-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FakeFirestore doesn't declare FieldValue #23
Comments
I've tried importing "firebase-admin" before "firestore-jest-mock" and calling |
To note how I use |
I would love to start a PR and work on this myself, but I cannot seem to figure out how to get my Node package to install local packages. (I mean, it installs just fine and points to the right file, but my tests behave as though no mock was made, whereas when I use your package by name and version, the above behavior occurs to indicate that the mock was successful). |
I think the error happend because FakeFirestore does't have the following fields implemented: |
Okay, I've got an implementation that tests well so far. PR soon. |
A bit of an issue in the firestore stub. If I'm reading it right, the firebase.firestore mock is implemented this way:
The canonical I'm not finding many answers readily online. Would something like the following work?
The idea is to expose both the constructor and static methods, so would this work if I have the |
Turns out that classes need the Solution: declare the
That seems to work in my testing, and Travis CI agrees. 😁 |
Description
I'm not quite sure what class is meant to mock over firebase.firestore (is that
FakeFirestore
?), but whatever it is doesn't seem to declareFieldValue
.Steps to reproduce
firebase.firestore.FieldValue
. In my case, I have a file that exports an object with a few Firebase helper types:mockFirebase
in tests, before importing source files under test.jest
Expected result
My tests should run, and fail for different reasons (failed assertions, etc).
Actual result
No tests ran, and this error appeared in the console:
Environment
The text was updated successfully, but these errors were encountered: