-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupTests.js
51 lines (47 loc) · 1.33 KB
/
setupTests.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
43
44
45
46
47
48
49
50
51
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter');
jest.mock('react-native-vector-icons/Ionicons', () => 'Icon');
jest.mock('react-native-vector-icons/MaterialCommunityIcons', () => 'Icon');
jest.mock('react-native-track-player', () => {
return {
addEventListener: jest.fn(),
registerEventHandler: jest.fn(),
registerPlaybackService: jest.fn(),
setupPlayer: jest.fn(),
destroy: jest.fn(),
updateOptions: jest.fn(),
add: jest.fn(),
remove: jest.fn(),
skip: jest.fn(),
skipToNext: jest.fn(),
skipToPrevious: jest.fn(),
removeUpcomingTracks: jest.fn(),
// playback commands
reset: jest.fn(),
play: jest.fn(),
pause: jest.fn(),
stop: jest.fn(),
seekTo: jest.fn(),
setVolume: jest.fn(),
setRate: jest.fn(),
// player getters
getQueue: jest.fn(),
getTrack: jest.fn(),
getCurrentTrack: jest.fn(),
getVolume: jest.fn(),
getDuration: jest.fn(),
getPosition: jest.fn(),
getBufferedPosition: jest.fn(),
getState: jest.fn(),
getRate: jest.fn(),
Capability: jest.fn(),
Event: jest.fn(),
RepeatMode: jest.fn(),
State: jest.fn(),
usePlaybackState: jest.fn(),
useProgress: jest.fn(),
useTrackPlayerEvents: jest.fn(),
};
});
Enzyme.configure({ adapter: new Adapter() });