2024-07-04 20:08:06 +02:00
|
|
|
/*
|
2024-09-09 15:57:16 +02:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2024-07-04 20:08:06 +02:00
|
|
|
Copyright 2024 The Matrix.org Foundation C.I.C.
|
|
|
|
|
2024-09-09 15:57:16 +02: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 20:08:06 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
export const mocks = {
|
|
|
|
AudioBufferSourceNode: {
|
|
|
|
connect: jest.fn(),
|
|
|
|
start: jest.fn(),
|
2024-07-08 14:44:54 +02:00
|
|
|
stop: jest.fn(),
|
2024-07-04 20:08:06 +02: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(),
|
|
|
|
},
|
|
|
|
};
|