-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.setup.js
42 lines (37 loc) · 1.03 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
34
35
36
37
38
39
40
41
42
try {
require('react-native-gesture-handler/jestSetup');
} catch (error) {
console.warn('react-native-gesture-handler/jestSetup not found. Skipping.');
}
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
Reanimated.default.call = () => {};
return Reanimated;
});
jest.mock('expo-router', () => ({
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
}),
}));
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock')
);
jest.mock('tamagui', () => ({
...jest.requireActual('tamagui'),
TamaguiProvider: ({ children }) => children,
Theme: ({ children }) => children,
ScrollView: ({ children }) => children,
YStack: ({ children }) => children,
Text: ({ children }) => children,
Card: ({ children }) => children,
Separator: () => null,
}));
jest.mock('./tamagui.config.ts', () => ({
config: {
settings: {
disableSSR: true,
},
},
}));