Closed CorentinDoue closed 3 years ago
Is there no need for the
initializeApp
call with@google-cloud/firestore
? Where does it get your app credentials from?
@google-cloud/firestore
use the same interface as the other @google-cloud
SDKs. There is no explicit authentication. The SDK will use the GOOGLE_APPLICATION_CREDENTIALS
environment variable to locate the credentials and authenticate.
Therefore the classic initialization of the firestore
client is only
const firestore = new Firestore({ projectId });
where firestore
has the same signature as firebase.firestore()
Would you mind adding a test? It could just be a "sanity" test to make sure you can do a simple query.
I copied the test full-setup.test.js
and adapted it to the @google-cloud/firestore
signature
Description
Add support for
@google-cloud/firestore
mocking. ExposemockGoogleCloudFirestore
asmockFirebase
.Related issues
Adresses https://github.com/Upstatement/firestore-jest-mock/issues/71
How to test
@google-cloud/firestore
firestore-jest-mock
to your project