firebase-functions-test icon indicating copy to clipboard operation
firebase-functions-test copied to clipboard

`makeDocumentSnapshot` check wrong option names.

Open rharter opened this issue 4 years ago • 3 comments
trafficstars

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

rharter avatar Nov 23 '20 22:11 rharter

@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_

tettoffensive avatar Dec 28 '20 19:12 tettoffensive

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.

rharter avatar Jan 05 '21 20:01 rharter

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.

tettoffensive avatar Jan 05 '21 21:01 tettoffensive