-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35542 from ruben-rebelo/ts-migration/react-native…
…-firebase-crashlytics-mock [No QA][TS migration] Migrate @react-native-firebase/crashlytics mock
- Loading branch information
Showing
2 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type {FirebaseCrashlyticsTypes} from '@react-native-firebase/crashlytics'; | ||
|
||
type CrashlyticsModule = Pick<FirebaseCrashlyticsTypes.Module, 'log' | 'recordError' | 'setCrashlyticsCollectionEnabled'>; | ||
|
||
type CrashlyticsMock = () => CrashlyticsModule; | ||
|
||
// <App> uses <ErrorBoundary> and we need to mock the imported crashlytics module | ||
// due to an error that happens otherwise https://github.com/invertase/react-native-firebase/issues/2475 | ||
const crashlyticsMock: CrashlyticsMock = () => ({ | ||
log: jest.fn(), | ||
recordError: jest.fn(), | ||
setCrashlyticsCollectionEnabled: jest.fn(), | ||
}); | ||
|
||
export default crashlyticsMock; |