-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
The code usage I'm having looks like:
export const firebaseApp = firebase.initializeApp(firebaseConfig);
// Used for creating child accounts, primarily
export const firebaseSecondaryApp = firebase.initializeApp(firebaseConfig, 'Secondary');
export const firebaseAuth = firebaseApp.auth();
export const firebaseSecondaryAuth = firebaseSecondaryApp.auth();
export const firebaseDb = firebaseApp.database();
export const firebaseFunc = firebaseApp.functions();
With my mocks just looking like this:
jest.mock('firebase/auth', () => ({}));
jest.mock('firebase/functions', () => ({}));
jest.mock('firebase/database', () => ({}));
jest.mock('firebase/app', () => {
const firebaseMock = require('firebase-mock');
const mockDatabase = new firebaseMock.MockFirebase();
const mockAuth = new firebaseMock.MockFirebase();
const mockSDK = new firebaseMock.MockFirebaseSdk((path: any) => {
return path ? mockDatabase.child(path) : mockDatabase;
}, () => {
return mockAuth;
});
const firebaseApp = mockSDK.initializeApp();
return mockSDK;
});
However my code gives me errors as there is no functions
method on the return value for initializeApp
Metadata
Metadata
Assignees
Labels
No labels