2024-07-04 18:08:06 +00:00
|
|
|
/*
|
2024-09-09 13:57:16 +00:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2024-07-04 18:08:06 +00:00
|
|
|
Copyright 2024 The Matrix.org Foundation C.I.C.
|
|
|
|
|
2024-09-09 13:57:16 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2024-07-04 18:08:06 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
export const mocks = {
|
|
|
|
AudioBufferSourceNode: {
|
|
|
|
connect: jest.fn(),
|
|
|
|
start: jest.fn(),
|
2024-07-08 12:44:54 +00:00
|
|
|
stop: jest.fn(),
|
2024-07-04 18:08:06 +00:00
|
|
|
} as unknown as AudioBufferSourceNode,
|
|
|
|
AudioContext: {
|
|
|
|
close: jest.fn(),
|
|
|
|
createMediaElementSource: jest.fn(),
|
|
|
|
createMediaStreamDestination: jest.fn(),
|
|
|
|
createMediaStreamSource: jest.fn(),
|
|
|
|
createStreamTrackSource: jest.fn(),
|
|
|
|
createBufferSource: jest.fn((): AudioBufferSourceNode => ({ ...mocks.AudioBufferSourceNode })),
|
|
|
|
getOutputTimestamp: jest.fn(),
|
|
|
|
resume: jest.fn(),
|
|
|
|
setSinkId: jest.fn(),
|
|
|
|
suspend: jest.fn(),
|
|
|
|
decodeAudioData: jest.fn(),
|
|
|
|
},
|
|
|
|
};
|