-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
The official require("firebase/app").firestore() function returns a singleton -- that is:
import firebase from "firebase/app";
firebase.initializeApp(/* ... */);
assert(firebase.firestore() === firebase.firestore()`); // always succeeds
However, the firebase-mock equivalent is inconsistent with that:
import {MockFirebaseSdk} from "firebase-mock";
const firebase = new MockFirebaseSdk();
assert(firebase.firestore() === firebase.firestore()); // always fails
To be consistent with the official firebase API, shouldn't additional calls to firestore() return the same singleton-value each time?
(This issue caused a lot of lost time in my project, as the configuration I made to one instance was mysteriously not being "seen" by another section of code, and it turned out to be due to the non-singleton behavior of the firebase-mock firestore() equivalent.)
Metadata
Metadata
Assignees
Labels
No labels