diff --git a/spec/test-utils/beacon.ts b/spec/test-utils/beacon.ts index 08771379af1..6cafd337898 100644 --- a/spec/test-utils/beacon.ts +++ b/spec/test-utils/beacon.ts @@ -101,26 +101,17 @@ export const makeGeolocationPosition = ({ }: { timestamp?: number; coords: Partial; -}): GeolocationPosition => { - const { toJSON, ...coordsJSON } = { - accuracy: 1, - latitude: 54.001927, - longitude: -8.253491, - altitude: null, - altitudeAccuracy: null, - heading: null, - speed: null, - ...coords, - }; - const posJSON = { +}): GeolocationPosition => + ({ timestamp: timestamp ?? 1647256791840, coords: { - toJSON: () => coordsJSON, - ...coordsJSON, + accuracy: 1, + latitude: 54.001927, + longitude: -8.253491, + altitude: null, + altitudeAccuracy: null, + heading: null, + speed: null, + ...coords, }, - }; - return { - toJSON: () => posJSON, - ...posJSON, - }; -}; + }) as GeolocationPosition; diff --git a/spec/test-utils/webrtc.ts b/spec/test-utils/webrtc.ts index 519701bdaa9..da3bc2ec0b6 100644 --- a/spec/test-utils/webrtc.ts +++ b/spec/test-utils/webrtc.ts @@ -147,13 +147,15 @@ export class MockRTCPeerConnection { } constructor() { - const localDescriptionJSON = { - sdp: DUMMY_SDP, - type: "offer" as RTCSdpType, - }; this.localDescription = { - toJSON: () => localDescriptionJSON, - ...localDescriptionJSON, + sdp: DUMMY_SDP, + type: "offer", + toJSON: function (): RTCSessionDescriptionInit { + return { + sdp: DUMMY_SDP, + type: "offer", + }; + }, }; this.readyToNegotiate = new Promise((resolve) => {