Conform more of the codebase to strictNullChecks (#11134)

This commit is contained in:
Michael Telatynski 2023-06-27 17:39:56 +01:00 committed by GitHub
parent 3d886de5b0
commit e1cad41bc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 44 additions and 36 deletions

View file

@ -41,7 +41,7 @@ describe("requestMediaPermissions", () => {
describe("when an audio and video device is available", () => {
beforeEach(() => {
mocked(navigator.mediaDevices.getUserMedia).mockImplementation(
async ({ audio, video }): Promise<MediaStream> => {
async ({ audio, video }: MediaStreamConstraints): Promise<MediaStream> => {
if (audio && video) return audioVideoStream;
return audioStream;
},
@ -56,7 +56,7 @@ describe("requestMediaPermissions", () => {
describe("when calling with video = false and an audio device is available", () => {
beforeEach(() => {
mocked(navigator.mediaDevices.getUserMedia).mockImplementation(
async ({ audio, video }): Promise<MediaStream> => {
async ({ audio, video }: MediaStreamConstraints): Promise<MediaStream> => {
if (audio && !video) return audioStream;
return audioVideoStream;
},
@ -72,7 +72,7 @@ describe("requestMediaPermissions", () => {
beforeEach(() => {
error.name = "NotFoundError";
mocked(navigator.mediaDevices.getUserMedia).mockImplementation(
async ({ audio, video }): Promise<MediaStream> => {
async ({ audio, video }: MediaStreamConstraints): Promise<MediaStream> => {
if (audio && video) throw error;
if (audio) return audioStream;
return audioVideoStream;
@ -103,7 +103,7 @@ describe("requestMediaPermissions", () => {
describe("when an Error is raised", () => {
beforeEach(async () => {
mocked(navigator.mediaDevices.getUserMedia).mockImplementation(
async ({ audio, video }): Promise<MediaStream> => {
async ({ audio, video }: MediaStreamConstraints): Promise<MediaStream> => {
if (audio && video) throw error;
return audioVideoStream;
},