-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest-setup.js
33 lines (27 loc) · 1.11 KB
/
jest-setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import 'react-native'
import 'react-native-gesture-handler/jestSetup'
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'
import mockSafeAreaContext from 'react-native-safe-area-context/jest/mock'
global.__reanimatedWorkletInit = jest.fn()
global.ReanimatedDataMock = { now: () => 0 }
require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests()
jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage)
jest.mock('poland-public-holidays', () => ({
__esModule: true,
isHoliday: jest.fn(() => false),
isWorkingDay: jest.fn((date) => ![0, 6].includes(date.getDay())),
}))
jest.mock('react-native-safe-area-context', () => mockSafeAreaContext)
jest.mock('@shopify/restyle', () => {
const RealModule = jest.requireActual('@shopify/restyle')
const RN = jest.requireActual('react-native')
RealModule.createText = () => RN.Text
RealModule.createBox = () => RN.View
RealModule.createRestyleComponent = (f, c) => c || RN.View
return RealModule
})
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key) => key,
}),
}))