-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
24 lines (22 loc) · 602 Bytes
/
jest.setup.js
File metadata and controls
24 lines (22 loc) · 602 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
// Mock do AudioContext para os testes
global.AudioContext = jest.fn().mockImplementation(() => ({
createOscillator: jest.fn().mockReturnValue({
connect: jest.fn(),
frequency: {
setValueAtTime: jest.fn()
},
start: jest.fn(),
stop: jest.fn()
}),
createGain: jest.fn().mockReturnValue({
connect: jest.fn(),
gain: {
setValueAtTime: jest.fn()
}
}),
destination: {},
currentTime: 0
}));
global.webkitAudioContext = global.AudioContext;
// Mock do setTimeout e setInterval
jest.useFakeTimers();