Remove MockedObject from mockMediaDevices type signature
This commit is contained in:
@@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
import { map, type Observable, of, type SchedulerLike } from "rxjs";
|
import { map, type Observable, of, type SchedulerLike } from "rxjs";
|
||||||
import { type RunHelpers, TestScheduler } from "rxjs/testing";
|
import { type RunHelpers, TestScheduler } from "rxjs/testing";
|
||||||
import { expect, type MockedObject, vi, vitest } from "vitest";
|
import { expect, vi, vitest } from "vitest";
|
||||||
import {
|
import {
|
||||||
type RoomMember,
|
type RoomMember,
|
||||||
type Room as MatrixRoom,
|
type Room as MatrixRoom,
|
||||||
@@ -418,15 +418,13 @@ export const deviceStub = {
|
|||||||
select(): void {},
|
select(): void {},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function mockMediaDevices(
|
export function mockMediaDevices(data: Partial<MediaDevices>): MediaDevices {
|
||||||
data: Partial<MediaDevices>,
|
return {
|
||||||
): MockedObject<MediaDevices> {
|
|
||||||
return vi.mocked<MediaDevices>({
|
|
||||||
audioInput: deviceStub,
|
audioInput: deviceStub,
|
||||||
audioOutput: deviceStub,
|
audioOutput: deviceStub,
|
||||||
videoInput: deviceStub,
|
videoInput: deviceStub,
|
||||||
...data,
|
...data,
|
||||||
} as MediaDevices);
|
} as MediaDevices;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mockMuteStates(
|
export function mockMuteStates(
|
||||||
|
|||||||
Reference in New Issue
Block a user