-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implement FieldValue.increment() #92
Conversation
src/unit-test.js
Outdated
@@ -604,6 +604,7 @@ QUnit.module('Unit | mock-cloud-firestore', (hooks) => { | |||
name: firebase.firestore.FieldValue.delete(), | |||
dad: db.collection('users').doc('user_b'), | |||
modifiedOn: firebase.firestore.FieldValue.serverTimestamp(), | |||
activeYears: mockFirebase.firestore.FieldValue.increment(-1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referencing mockFirebase
here because I was not able to update the firebase
dependency to a version that contains this without running into build issues that I wasn't able to resolve without too much digging. If we can get that working, that would make this more correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the build error you're getting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says that core-js is not found for importing. As far as I can tell, this has something to do with polyfills and Babel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've investigated it and it's because of some recent babel changes. I've fixed that in the master branch. Could you try rebasing this PR from that? Once you do, firebase
should now work which is what's actually you should use for the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I have now rebased and updated the tests to use firebase.firestore.FieldValue.increment()
, and things seem to be working 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @kimroen
919a4ed
to
a4301bf
Compare
Implements
FieldValue.increment()
in order to resolve #91Hopefully it's useful as a reference if nothing else!