I am developing an Angular application, with angularfire2 5.0.0-rc.10
. I really hope I don't mess up any terms in the following, but here we go.
I have converted Date's, to the new firestore Timestamp type. This gives me a problem when writing tests. I can only do the following:
import { firestore } from 'firebase/app';
it ('should create', () => {
firestore.Timestamp.now();
});
If I initialize firebase in my TestBed module with:
AngularFireModule.initializeApp(environment.firebase),
Otherwise I get the error:
TypeError: Cannot read property 'Timestamp' of undefined
So my questions:
firestore undefined
when imported without the initializeApp?Thanks so much for your help.
I resolved it below
angular version is 11.1.2
import firebase from 'firebase/app';
import 'firebase/firestore';
import Timestamp = firebase.firestore.Timestamp;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With