-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
23 lines (19 loc) · 776 Bytes
/
jest.setup.js
File metadata and controls
23 lines (19 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Mock Date.now() to return a fixed timestamp
const FIXED_TIMESTAMP = new Date('2024-01-01T12:00:00Z').getTime();
global.Date.now = jest.fn(() => FIXED_TIMESTAMP);
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
Reanimated.default.call = () => {};
return Reanimated;
});
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
);
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
// Mock MyText component to render actual text
jest.mock('components/MyText', () => {
const React = require('react');
return function MyText(props) {
return React.createElement('Text', props, props.children);
};
});