Skip to content

Commit a8b28d2

Browse files
committed
Fix integration test
1 parent 6291938 commit a8b28d2

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

integration/firestore/firebase_export.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,25 @@ import {
2727

2828
let appCount = 0;
2929

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+
3043
export function newTestFirestore(
31-
projectId: string,
32-
nameOrApp?: string | FirebaseApp,
33-
settings?: FirestoreSettings
44+
app: FirebaseApp,
45+
settings?: FirestoreSettings,
46+
dbName?: string
3447
): 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);
4349
}
4450

4551
export * from '@firebase/firestore';

0 commit comments

Comments
 (0)