How to fix TypeError is not a function (testing promises with Jest)
问题 I have a passing test now thanks to the answer here: How to test is chained promises in a jest test? However I'm still getting an error in the catch part of my test. I seem to not be able to correctly mock or spy this part in the actions file: .then(res => res.getIdToken()) TEST signIn ERROR => TypeError: res.getIdToken is not a function The Test jest.mock('services/firebase', () => new Promise(resolve => resolve({ signInWithEmailAndPassword: () => Promise.resolve({ getIdToken: 'abc123' }),