Replies: 5 comments
-
I wonder if mock-cloud-firestore could be wired in until emberfire has an officially-supported testing story? FWIW, a decent testing setup is what's currently keeping me on https://github.com/mikkopaderes/ember-cloud-firestore-adapter The current Guides still link to a WIP testing addition that looked promising, but hasn't been touched in a few years, and not sure how that translates to v3. @jamesdaniels any recommendations on how to do testing with emberfire today? (or thoughts on how testing support could/should be added? ) |
Beta Was this translation helpful? Give feedback.
-
There is now also the emulator https://firebase.google.com/docs/emulator-suite, I've been using that. |
Beta Was this translation helpful? Give feedback.
-
Thanks. Iirc, I was having these problems with the emulator. I have been able to test my cloud functions with the emulator outside of ember (mostly cleaning up functions, etc.), but couldn't get the ember site to use an emulated database. What I've settled on is making a duplicate of the production db and just developing by talking to the duplicate live. I've also put a graphql layer in between ember and firestore, taking emberfire out of the mix, so that I can use something with a slightly clearer testing story. mock-cloud-firestore looked promising back when I posted my initial questions, but, as with the emulator, it seemed like it solved problems on the backend, not on the client side. But maybe I've forgotten since. |
Beta Was this translation helpful? Give feedback.
-
Can someone who has previously integrated emberfire and firebase emulator document how that is done here? |
Beta Was this translation helpful? Give feedback.
-
if its a case of just wanting to connect to an emulated firestore then drop this in your
|
Beta Was this translation helpful? Give feedback.
-
EmberFire is working for me reasonably well in development, but I simply cannot get acceptance tests to work at all. I'd love to just switch testing to Mirage, but I can't figure out how to get Mirage to hijack the tests and get the FirestoreAdapter out of the picture.
Namely, if I run my acceptance tests with persistence off (
export default class ApplicationAdapter extends FirestoreAdapter {}
), then I get errors likeFailed to get document because the client is offline. FirebaseError: Failed to get document because the client is offline.
andCould not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
.If I set
enablePersistence
totrue
, etc., then I get this error over and over:Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.
Everything I see that's closely related on SO is half a decade old.
Any tips on, again, hijacking the adapter w/ Mirage in testing or getting the right mix of hooks for mocha to let the acceptance tests to work with persistence either on or off would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions