ESModules
ESModules
.Firebase
no esta definido.Creamos los tests de manera manual (manual mocks) manual mock de auth y delete.
const firestore = jest.fn(() => ({
collection: (name) => ({
delete: (id) => new Promise((resolve) => {
resolve(Nota eliminada: ${id}
)
})
})
}))
const auth = jest.fn(() => ({ signInWithEmailAndPassword: (email, password) => { return new Promise((resolve) => { resolve({ email: email }) }) } }))
const firebase = jest.genMockFromModule(‘../src/firebase.js’);
firebase.firestore = firestore; firebase.auth = auth;
export default firebase;