diff --git a/bower.json b/bower.json index db696708..b4ed8fdd 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "firebase-mock", - "version": "1.1.4", + "version": "1.1.5", "homepage": "https://github.com/soumak77/firebase-mock", "authors": [ "Kato" diff --git a/browser/firebasemock.js b/browser/firebasemock.js index 2bd47f67..e64ebf97 100644 --- a/browser/firebasemock.js +++ b/browser/firebasemock.js @@ -1,4 +1,4 @@ -/** firebase-mock - v1.1.4 +/** firebase-mock - v1.1.5 https://github.com/soumak77/firebase-mock * Copyright (c) 2016 Brian Soumakian * License: MIT */ @@ -18336,27 +18336,61 @@ exports.Event = FlushEvent; },{"events":3,"lodash":13,"util":7}],21:[function(require,module,exports){ var MockFirebase = require('./firebase'); +var EmailAuthProvider = function() { + this.providerId = EmailAuthProvider.PROVIDER_ID; +}; +EmailAuthProvider.PROVIDER_ID = "password"; +EmailAuthProvider.credential = function() { + return new AuthCredential(EmailAuthProvider.PROVIDER_ID); +}; + +var GoogleAuthProvider = function() { + this.providerId = GoogleAuthProvider.PROVIDER_ID; +}; +GoogleAuthProvider.PROVIDER_ID = "google.com"; +GoogleAuthProvider.credential = function() { + return new AuthCredential(GoogleAuthProvider.PROVIDER_ID); +}; + +var TwitterAuthProvider = function() { + this.providerId = TwitterAuthProvider.PROVIDER_ID; +}; +TwitterAuthProvider.PROVIDER_ID = "twitter.com"; +TwitterAuthProvider.credential = function() { + return new AuthCredential(TwitterAuthProvider.PROVIDER_ID); +}; + +var FacebookAuthProvider = function() { + this.providerId = FacebookAuthProvider.PROVIDER_ID; +}; +FacebookAuthProvider.PROVIDER_ID = "facebook.com"; +FacebookAuthProvider.credential = function() { + return new AuthCredential(FacebookAuthProvider.PROVIDER_ID); +}; + +var GithubAuthProvider = function() { + this.providerId = GithubAuthProvider.PROVIDER_ID; +}; +GithubAuthProvider.PROVIDER_ID = "github.com"; +GithubAuthProvider.credential = function() { + return new AuthCredential(GithubAuthProvider.PROVIDER_ID); +}; + +var AuthCredential = function(provider) { + this.providerId = provider; +}; + function MockFirebaseSdk(createDatabase, createAuth) { function MockFirebaseAuth() { var auth = createAuth ? createAuth() : new MockFirebase(); delete auth.ref; return auth; } - MockFirebaseAuth.EmailAuthProvider = function() { - this.providerId = "password"; - }; - MockFirebaseAuth.GoogleAuthProvider = function() { - this.providerId = "google.com"; - }; - MockFirebaseAuth.TwitterAuthProvider = function() { - this.providerId = "twitter.com"; - }; - MockFirebaseAuth.FacebookAuthProvider = function() { - this.providerId = "facebook.com"; - }; - MockFirebaseAuth.GithubAuthProvider = function() { - this.providerId = "github.com"; - }; + MockFirebaseAuth.EmailAuthProvider = EmailAuthProvider; + MockFirebaseAuth.GoogleAuthProvider = GoogleAuthProvider; + MockFirebaseAuth.TwitterAuthProvider = TwitterAuthProvider; + MockFirebaseAuth.FacebookAuthProvider = FacebookAuthProvider; + MockFirebaseAuth.GithubAuthProvider = GithubAuthProvider; function MockFirebaseDatabase() { return { diff --git a/package.json b/package.json index fdfb84e4..ac8bcb22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firebase-mock", - "version": "1.1.4", + "version": "1.1.5", "description": "Firebase mock library for writing unit tests", "main": "./src", "scripts": {