File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -27,19 +27,25 @@ import {
27
27
28
28
let appCount = 0 ;
29
29
30
+ export function newTestApp ( projectId : string , appName ?: string ) : FirebaseApp {
31
+ if ( appName === undefined ) {
32
+ appName = 'test-app-' + appCount ++ ;
33
+ }
34
+ return initializeApp (
35
+ {
36
+ apiKey : 'fake-api-key' ,
37
+ projectId
38
+ } ,
39
+ appName
40
+ ) ;
41
+ }
42
+
30
43
export function newTestFirestore (
31
- projectId : string ,
32
- nameOrApp ?: string | FirebaseApp ,
33
- settings ?: FirestoreSettings
44
+ app : FirebaseApp ,
45
+ settings ?: FirestoreSettings ,
46
+ dbName ?: string
34
47
) : Firestore {
35
- if ( nameOrApp === undefined ) {
36
- nameOrApp = 'test-app-' + appCount ++ ;
37
- }
38
- const app =
39
- typeof nameOrApp === 'string'
40
- ? initializeApp ( { apiKey : 'fake-api-key' , projectId } , nameOrApp )
41
- : nameOrApp ;
42
- return initializeFirestore ( app , settings || { } ) ;
48
+ return initializeFirestore ( app , settings || { } , dbName ) ;
43
49
}
44
50
45
51
export * from '@firebase/firestore' ;
You can’t perform that action at this time.
0 commit comments