Skip to content

Commit

Permalink
Merge pull request #771 from firebase/jw-signOut-promise
Browse files Browse the repository at this point in the history
Updated signOut() to return a promise
  • Loading branch information
katowulf committed Jun 21, 2016
2 parents a736588 + 046e7f8 commit 49452e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FirebaseAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@
*/
signOut: function() {
if (this.getAuth() !== null) {
this._auth.signOut();
return this._q.when(this._auth.signOut());
} else {
return this._q.when();
}
},

Expand Down
4 changes: 4 additions & 0 deletions tests/unit/FirebaseAuth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ describe('FirebaseAuth',function(){
});

describe('$signOut()',function(){
it('should return a promise', function() {
expect(authService.$signOut()).toBeAPromise();
});

it('will call signOut() on backing auth instance when user is signed in',function(){
spyOn(authService._, 'getAuth').and.callFake(function () {
return {provider: 'facebook'};
Expand Down

0 comments on commit 49452e3

Please sign in to comment.