-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_setup.js
More file actions
32 lines (25 loc) · 750 Bytes
/
test_setup.js
File metadata and controls
32 lines (25 loc) · 750 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
29
30
31
32
// @flow
import Enzyme, {shallow} from 'enzyme';
import snapshotDiff from 'snapshot-diff';
import Adapter from 'enzyme-adapter-react-16';
import mockAsyncStorage from '@react-native-community/async-storage/jest/async-storage-mock';
Enzyme.configure({adapter: new Adapter()});
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter', () => {
jest.fn();
return class foo1 {
constructor(lol) {
this.hitt = lol;
}
bleManagerEmitter = {
addListener: () => {
'bar';
},
start: () => {},
};
static start() {}
addListener = () => {};
};
});
jest.mock('@react-native-community/async-storage', () => mockAsyncStorage);
global.snapshotDiff = snapshotDiff;
global.shallow = shallow;