diff --git a/src/FirebaseAuth.js b/src/FirebaseAuth.js index 60ee0def..a4d84884 100644 --- a/src/FirebaseAuth.js +++ b/src/FirebaseAuth.js @@ -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(); } }, diff --git a/tests/unit/FirebaseAuth.spec.js b/tests/unit/FirebaseAuth.spec.js index 1ace3203..ad5f4d32 100644 --- a/tests/unit/FirebaseAuth.spec.js +++ b/tests/unit/FirebaseAuth.spec.js @@ -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'};