diff --git a/package.json b/package.json index 89dc3c3aafe..2b67e929dee 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "typedoc-plugin-coverage": "^3.0.0", "typedoc-plugin-mdn-links": "^3.0.3", "typedoc-plugin-missing-exports": "^3.0.0", - "typescript": "^5.3.3" + "typescript": "^5.4.2" }, "@casualbot/jest-sonar-reporter": { "outputDirectory": "coverage", diff --git a/spec/test-utils/beacon.ts b/spec/test-utils/beacon.ts index 9cfebf95675..08771379af1 100644 --- a/spec/test-utils/beacon.ts +++ b/spec/test-utils/beacon.ts @@ -101,9 +101,8 @@ export const makeGeolocationPosition = ({ }: { timestamp?: number; coords: Partial; -}): GeolocationPosition => ({ - timestamp: timestamp ?? 1647256791840, - coords: { +}): GeolocationPosition => { + const { toJSON, ...coordsJSON } = { accuracy: 1, latitude: 54.001927, longitude: -8.253491, @@ -112,5 +111,16 @@ export const makeGeolocationPosition = ({ heading: null, speed: null, ...coords, - }, -}); + }; + const posJSON = { + timestamp: timestamp ?? 1647256791840, + coords: { + toJSON: () => coordsJSON, + ...coordsJSON, + }, + }; + return { + toJSON: () => posJSON, + ...posJSON, + }; +}; diff --git a/spec/test-utils/webrtc.ts b/spec/test-utils/webrtc.ts index 9b91a3d272b..519701bdaa9 100644 --- a/spec/test-utils/webrtc.ts +++ b/spec/test-utils/webrtc.ts @@ -147,10 +147,13 @@ export class MockRTCPeerConnection { } constructor() { - this.localDescription = { + const localDescriptionJSON = { sdp: DUMMY_SDP, - type: "offer", - toJSON: function () {}, + type: "offer" as RTCSdpType, + }; + this.localDescription = { + toJSON: () => localDescriptionJSON, + ...localDescriptionJSON, }; this.readyToNegotiate = new Promise((resolve) => { @@ -265,7 +268,7 @@ export class MockRTCRtpTransceiver { this.peerConn.needsNegotiation = true; } - public setCodecPreferences = jest.fn(); + public setCodecPreferences = jest.fn(); } export class MockMediaStreamTrack { diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 6a8a15e0612..c2b24cadb82 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -2024,7 +2024,7 @@ export class MatrixCall extends TypedEventEmitter