-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest-setup.js
More file actions
28 lines (23 loc) · 849 Bytes
/
Copy pathjest-setup.js
File metadata and controls
28 lines (23 loc) · 849 Bytes
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
import fetchMock from 'jest-fetch-mock';
import 'react-native-gesture-handler/jestSetup';
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock';
// Suppress console.log, console.warn, and console.error in test environment
global.console = {
...console,
log: jest.fn(), // Suppress console.log
warn: jest.fn(), // Suppress console.warn
error: jest.fn(), // Suppress console.error
};
fetchMock.enableMocks();
jest.mock('react-native-reanimated', () =>
require('react-native-reanimated/mock'),
);
jest.mock('react-native-gesture-handler', () =>
require('react-native-gesture-handler/jestSetup'),
);
// Mock AsyncStorage
jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage);
jest.mock(
'./src/components/HearthWithLiquidButton',
() => 'HeartWithLiquidButton',
);