-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathexpo-av.ts
More file actions
36 lines (33 loc) · 1 KB
/
expo-av.ts
File metadata and controls
36 lines (33 loc) · 1 KB
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
// Mock for expo-av
export const Audio = {
setAudioModeAsync: jest.fn().mockResolvedValue(undefined),
Sound: class MockSound {
static createAsync = jest.fn().mockResolvedValue({
sound: new this(),
status: { isLoaded: true },
});
playAsync = jest.fn().mockResolvedValue({ status: { isPlaying: true } });
stopAsync = jest.fn().mockResolvedValue({ status: { isPlaying: false } });
unloadAsync = jest.fn().mockResolvedValue(undefined);
setVolumeAsync = jest.fn().mockResolvedValue(undefined);
},
setIsEnabledAsync: jest.fn().mockResolvedValue(undefined),
getPermissionsAsync: jest.fn().mockResolvedValue({
granted: true,
canAskAgain: true,
expires: 'never',
status: 'granted',
}),
requestPermissionsAsync: jest.fn().mockResolvedValue({
granted: true,
canAskAgain: true,
expires: 'never',
status: 'granted',
}),
};
export const InterruptionModeIOS = {
MixWithOthers: 0,
DoNotMix: 1,
DuckOthers: 2,
};
export const AVPlaybackSource = {};