How can I test chained promises in a Jest test?

前端 未结 2 1569
遇见更好的自我
遇见更好的自我 2021-01-19 17:43

Below I have a test for my login actions. I\'m mocking a Firebase function and want to test if the signIn/signOut functions are called.

The

2条回答
  •  离开以前
    2021-01-19 18:12

    Login actions › signIn should call firebase

    TypeError: auth.signInWithEmailAndPassword is not a function

    This tells that your store.dispatch(signIn(user.email, user.password)) fails, thus your second console.log won't go into your then chain, use catch or second callback argument of then instead.

提交回复
热议问题