forked from gladly-team/next-firebase-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gladly-team#265): support modular Firebase 9
- Loading branch information
Showing
13 changed files
with
487 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
const firebaseAppMock = jest.createMockFromModule('firebase') | ||
firebaseAppMock.apps = [] | ||
const firebaseAppMock = jest.createMockFromModule('firebase/app') | ||
|
||
const mockOnIdTokenChangedUnsubscribe = jest.fn() | ||
const mockOnIdTokenChanged = jest.fn(() => mockOnIdTokenChangedUnsubscribe) | ||
const mockSignOut = jest.fn(() => Promise.resolve()) | ||
|
||
firebaseAppMock.auth = jest.fn(() => ({ | ||
onIdTokenChanged: mockOnIdTokenChanged, | ||
signOut: mockSignOut, | ||
})) | ||
firebaseAppMock.getApps = jest.fn(() => []) | ||
|
||
module.exports = firebaseAppMock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
module.exports = jest.fn() | ||
const firebaseAuthMock = jest.createMockFromModule('firebase/auth') | ||
|
||
const mockOnIdTokenChangedUnsubscribe = jest.fn() | ||
const mockOnIdTokenChanged = jest.fn(() => mockOnIdTokenChangedUnsubscribe) | ||
const mockSignOut = jest.fn(() => Promise.resolve()) | ||
|
||
firebaseAuthMock.onIdTokenChanged = mockOnIdTokenChanged | ||
firebaseAuthMock.signOut = mockSignOut | ||
|
||
module.exports = firebaseAuthMock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.