File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export class Firestore implements firestore.FirebaseFirestore {
58
58
throw new FirestoreError (
59
59
Code . FAILED_PRECONDITION ,
60
60
'Firestore has already been started and its settings can no longer ' +
61
- 'be changed. initializeFirestore() can only be called before calling ' +
61
+ 'be changed. initializeFirestore() cannot be called after calling ' +
62
62
'getFirestore().'
63
63
) ;
64
64
}
Original file line number Diff line number Diff line change @@ -38,4 +38,17 @@ describe('Firestore', () => {
38
38
const fs2 = getFirestore ( app ) ;
39
39
expect ( fs1 === fs2 ) . to . be . true ;
40
40
} ) ;
41
+
42
+ it ( 'cannot call initializeFirestore() after getFirestore()' , ( ) => {
43
+ const app = initializeApp (
44
+ { apiKey : 'fake-api-key' , projectId : 'test-project' } ,
45
+ 'test-app-getFirestore-initializeFirestore'
46
+ ) ;
47
+ getFirestore ( app ) ;
48
+ expect ( ( ) => initializeFirestore ( app , { } ) ) . to . throw (
49
+ 'Firestore has already been started and its settings can no longer ' +
50
+ 'be changed. initializeFirestore() cannot be called after calling ' +
51
+ 'getFirestore().'
52
+ ) ;
53
+ } ) ;
41
54
} ) ;
You can’t perform that action at this time.
0 commit comments