-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
Example
const unsubFirestore = FirebaseProvider.firestore()
.collection(FirestoreCollections.ProfilesCollectionName)
.doc(user?.uid)
.onSnapshot({
next: (snap) =>
DocumentSnapshotToHookWithItem<IProfile, IProfileWithKey>(
snap,
onSnapshot,
),
error: (error) => {
setProfileItem({...profileItem, error});
},
});Expected behavior
Mocked snapshot is passed
Actual behaviour
TypeError: _FirebaseProvider.default.firestore(...).collection(...).doc(...).onSnapshot is not a function
64 | .collection(FirestoreCollections.ProfilesCollectionName)
65 | .doc(user?.uid)
> 66 | .onSnapshot({
| ^
67 | next: (snap) =>
68 | DocumentSnapshotToHookWithItem<IProfile, IProfileWithKey>(
69 | snap,So I read you guys have been trying to fix this and there is supposedly a merged fix for onSnapshot, but I sure can't get it to work. Already tried:
- npm usage of latest version
- npm install directly from this github (https://github.com/soumak77/firebase-mock/)
- npm install from https://github.com/dmurvihill/firebase-mock
Appreciate anyone who got a working solution for Firebase Firestore snapshots using
- Jest
- TypeScript
- React/Native
- Travis/CI
Metadata
Metadata
Assignees
Labels
No labels