Open BrianChapman opened 5 years ago
I've just submitted a pull request that similarly modifies createUserWithEmailAndPassword.
+1 This really caught me off guard when we first started to use firebase-mock
. After digging through the source, finally figured out that the API of firebase-mock
differs from that of the actual Firebase SDK. It makes it hard to actually use firebase-mock
in production code, because we would have to adjust the code to handle two APIs (and risk hard-to-catch bugs).
The signInWithEmailAndPassword method is supposed to return a promise containing [UserCredential] (https://firebase.google.com/docs/reference/js/firebase.auth#.UserCredential) but it returns a partial user object (https://github.com/soumak77/firebase-mock/blob/master/src/firebase-auth.js#L124)
In fact all return a UserCredential except signInWithCredential which does return a user, signInWithPhoneNumber which returns a ConfirmationResult, and signInWithRedirect which returns void.