firebase / firebase-functions-test

MIT License
234 stars 52 forks source link

`makeDocumentSnapshot` check wrong option names. #79

Open rharter opened 3 years ago

rharter commented 3 years ago

makeDocumentSnapshot checks the options to see if there is an app property, but DocumentSnapshotOptions calls it firebaseApp. This leads to some weird casting requirements to use makeDocumentSnapshot with your own initialized app.

This issue is here.

https://github.com/firebase/firebase-functions-test/blob/22ba3d1c9430c62c32f26790b8a60abf5955405e/src/providers/firestore.ts#L58

tettoffensive commented 3 years ago

@rharter Since your pull request is kinda in the same area as the issue I'm experiencing (and I'm not seeing any other activity here) I thought I'd ask if your experiencing what I'm seeing in #87 where makeDocumentSnapshot doesn't work because it's trying to use .snapshot_

rharter commented 3 years ago

I haven't run into that, but I'm also not using the function from a class implementation, I've been using it statically and passing in my app, so I can't say it's not related.

tettoffensive commented 3 years ago

Thanks. I tried it statically and get the same error. It seems to me that makeDocumentSnapshot relies on the Node.js Server SDK for Google Cloud Firestore. So it doesn't work when testing the Node.js client for Firestore despite what the documentation says.