diff options
Diffstat (limited to 'jest/jestSetup.js')
-rw-r--r-- | jest/jestSetup.js | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/jest/jestSetup.js b/jest/jestSetup.js index 7a2f10d2d..1cad50c7a 100644 --- a/jest/jestSetup.js +++ b/jest/jestSetup.js @@ -1,17 +1,17 @@ +import 'react-native-gesture-handler/jestSetup' jest.mock('@react-native-async-storage/async-storage', () => require('@react-native-async-storage/async-storage/jest/async-storage-mock'), ) jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter') +// Silence the warning: Animated: `useNativeDriver` is not supported +jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper') +require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests() + jest.mock('@fortawesome/react-native-fontawesome', () => ({ FontAwesomeIcon: '', })) -require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests() - -// Silence the warning: Animated: `useNativeDriver` is not supported -jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper') - jest.mock('react-native-safe-area-context', () => { const inset = {top: 0, right: 0, bottom: 0, left: 0} return { @@ -36,4 +36,18 @@ jest.mock('@gorhom/bottom-sheet', () => { } }) -jest.useFakeTimers() +jest.mock('rn-fetch-blob', () => ({ + config: jest.fn().mockReturnThis(), + cancel: jest.fn(), + fetch: jest.fn(), +})) + +jest.mock('@bam.tech/react-native-image-resizer', () => ({ + createResizedImage: jest.fn(), +})) + +import {View as mockedView} from 'react-native' +jest.mock('react-native-tab-view', () => ({ + ...jest.requireActual('react-native-tab-view'), + TabView: mockedView, +})) |