mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-22 20:51:29 +10:00
Jest mocks: added @reach/router and stub for Firebase auth signOut method
This commit is contained in:
@ -57,7 +57,7 @@ class Auth {
|
||||
user.email,
|
||||
user.isAnonymous,
|
||||
user.uid,
|
||||
async () => {},
|
||||
this.signOut,
|
||||
);
|
||||
|
||||
await delay(Constants.defaultDelayInMilliseconds);
|
||||
@ -68,6 +68,20 @@ class Auth {
|
||||
|
||||
return this._currentUser;
|
||||
}
|
||||
|
||||
async signOut() {
|
||||
if (this._currentUser === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._currentUser = null;
|
||||
|
||||
await delay(Constants.defaultDelayInMilliseconds);
|
||||
|
||||
this.onAuthStateChangedObservers.forEach((observer) =>
|
||||
observer(this._currentUser),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Auth;
|
||||
|
||||
Reference in New Issue
Block a user