From d56fa197d05aada8bc788e004ba706e6b6f211a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:23:38 +0000 Subject: [PATCH] Update dependency typescript to v5.6.2 (#4420) * Update dependency typescript to v5.6.2 * Fix TS errors * Update minimal version of TS to `5.4.2` since the code is not compliant with an older version. * Review fixes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Florian Duros Co-authored-by: Florian Duros --- package.json | 2 +- spec/test-utils/beacon.ts | 20 +++++++++++++++----- spec/test-utils/webrtc.ts | 11 +++++++---- src/webrtc/call.ts | 6 +++--- yarn.lock | 8 ++++---- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 89dc3c3aa..2b67e929d 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 9cfebf956..08771379a 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 9b91a3d27..519701bda 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 6a8a15e06..c2b24cadb 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -2024,7 +2024,7 @@ export class MatrixCall extends TypedEventEmitter