forked from react-navigation/react-navigation
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest-setup.js
More file actions
28 lines (25 loc) · 665 Bytes
/
jest-setup.js
File metadata and controls
28 lines (25 loc) · 665 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
/**
* @flow
* eslint-env jest
*/
// See https://github.com/facebook/jest/issues/2208
jest.mock('Linking', () => ({
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
openURL: jest.fn(),
canOpenURL: jest.fn(),
getInitialURL: jest
.fn()
.mockImplementation((value: string) => Promise.resolve(value)),
}));
// See https://github.com/facebook/react-native/issues/11659
jest.mock('ScrollView', () => {
// $FlowExpectedError
const RealComponent = require.requireActual('ScrollView');
class ScrollView extends RealComponent {
scrollTo = () => {};
}
return ScrollView;
});
// $FlowExpectedError
Date.now = jest.fn(() => 0);