You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
Update dependency prettier to v3 (#3983)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@ -1263,7 +1263,7 @@ describe("Crypto", function () {
|
||||
({
|
||||
init_with_private_key: jest.fn(),
|
||||
free,
|
||||
} as unknown as PkDecryption),
|
||||
}) as unknown as PkDecryption,
|
||||
);
|
||||
client.client.checkSecretStoragePrivateKey(new Uint8Array(), "");
|
||||
expect(free).toHaveBeenCalled();
|
||||
@ -1289,7 +1289,7 @@ describe("Crypto", function () {
|
||||
({
|
||||
init_with_seed: jest.fn(),
|
||||
free,
|
||||
} as unknown as PkSigning),
|
||||
}) as unknown as PkSigning,
|
||||
);
|
||||
client.client.checkCrossSigningPrivateKey(new Uint8Array(), "");
|
||||
expect(free).toHaveBeenCalled();
|
||||
|
@ -106,7 +106,7 @@ describe("Cross Signing", function () {
|
||||
});
|
||||
alice.uploadKeySignatures = async () => ({ failures: {} });
|
||||
alice.setAccountData = async () => ({});
|
||||
alice.getAccountDataFromServer = async <T>() => ({} as T);
|
||||
alice.getAccountDataFromServer = async <T>() => ({}) as T;
|
||||
// set Alice's cross-signing key
|
||||
await alice.bootstrapCrossSigning({
|
||||
authUploadDeviceSigningKeys: async (func) => {
|
||||
@ -146,7 +146,7 @@ describe("Cross Signing", function () {
|
||||
};
|
||||
alice.uploadKeySignatures = async () => ({ failures: {} });
|
||||
alice.setAccountData = async () => ({});
|
||||
alice.getAccountDataFromServer = async <T extends { [k: string]: any }>(): Promise<T | null> => ({} as T);
|
||||
alice.getAccountDataFromServer = async <T extends { [k: string]: any }>(): Promise<T | null> => ({}) as T;
|
||||
const authUploadDeviceSigningKeys: BootstrapCrossSigningOpts["authUploadDeviceSigningKeys"] = async (func) => {
|
||||
await func({});
|
||||
};
|
||||
|
@ -189,12 +189,10 @@ describe("SAS verification", function () {
|
||||
const origSendToDevice = bob.client.sendToDevice.bind(bob.client);
|
||||
bob.client.sendToDevice = async (type, map) => {
|
||||
if (type === "m.key.verification.accept") {
|
||||
macMethod = map
|
||||
.get(alice.client.getUserId()!)
|
||||
?.get(alice.client.deviceId!)?.message_authentication_code;
|
||||
keyAgreement = map
|
||||
.get(alice.client.getUserId()!)
|
||||
?.get(alice.client.deviceId!)?.key_agreement_protocol;
|
||||
macMethod = map.get(alice.client.getUserId()!)?.get(alice.client.deviceId!)
|
||||
?.message_authentication_code;
|
||||
keyAgreement = map.get(alice.client.getUserId()!)?.get(alice.client.deviceId!)
|
||||
?.key_agreement_protocol;
|
||||
}
|
||||
return origSendToDevice(type, map);
|
||||
};
|
||||
|
@ -213,7 +213,7 @@ describe("MSC3089Branch", () => {
|
||||
expect(eventId).toEqual(fileEventId);
|
||||
return fileEvent;
|
||||
},
|
||||
} as EventTimelineSet);
|
||||
}) as EventTimelineSet;
|
||||
client.mxcUrlToHttp = (mxc: string) => {
|
||||
expect(mxc).toEqual("mxc://" + mxcLatter);
|
||||
return `https://example.org/_matrix/media/v1/download/${mxcLatter}`;
|
||||
@ -239,7 +239,7 @@ describe("MSC3089Branch", () => {
|
||||
expect(eventId).toEqual(fileEventId);
|
||||
return fileEvent;
|
||||
},
|
||||
} as EventTimelineSet);
|
||||
}) as EventTimelineSet;
|
||||
client.mxcUrlToHttp = (mxc: string) => {
|
||||
expect(mxc).toEqual("mxc://" + mxcLatter);
|
||||
return `https://example.org/_matrix/media/v1/download/${mxcLatter}`;
|
||||
@ -332,7 +332,7 @@ describe("MSC3089Branch", () => {
|
||||
getId: () => "$unknown",
|
||||
},
|
||||
];
|
||||
staticRoom.getLiveTimeline = () => ({ getEvents: () => events } as EventTimeline);
|
||||
staticRoom.getLiveTimeline = () => ({ getEvents: () => events }) as EventTimeline;
|
||||
|
||||
directory.getFile = (evId: string) => {
|
||||
expect(evId).toEqual(fileEventId);
|
||||
|
@ -399,7 +399,7 @@ describe("MSC3089TreeSpace", () => {
|
||||
];
|
||||
},
|
||||
};
|
||||
client.getRoom = () => ({} as Room); // to appease the TreeSpace constructor
|
||||
client.getRoom = () => ({}) as Room; // to appease the TreeSpace constructor
|
||||
|
||||
const getFn = jest.fn().mockImplementation((roomId: string) => {
|
||||
if (roomId === thirdChildRoom) {
|
||||
@ -422,7 +422,7 @@ describe("MSC3089TreeSpace", () => {
|
||||
});
|
||||
|
||||
it("should find specific directories", () => {
|
||||
client.getRoom = () => ({} as Room); // to appease the TreeSpace constructor
|
||||
client.getRoom = () => ({}) as Room; // to appease the TreeSpace constructor
|
||||
|
||||
// Only mocking used API
|
||||
const firstSubdirectory = { roomId: "!first:example.org" } as any as MSC3089TreeSpace;
|
||||
|
@ -32,7 +32,10 @@ export class DummyTransport<D extends RendezvousTransportDetails, T> implements
|
||||
ready = false;
|
||||
cancelled = false;
|
||||
|
||||
constructor(private name: string, private mockDetails: D) {}
|
||||
constructor(
|
||||
private name: string,
|
||||
private mockDetails: D,
|
||||
) {}
|
||||
onCancelled?: RendezvousFailureListener;
|
||||
|
||||
details(): Promise<RendezvousTransportDetails> {
|
||||
|
@ -3315,7 +3315,7 @@ describe("Room", function () {
|
||||
return event1 === `eventId${i}` ? 1 : -1;
|
||||
},
|
||||
findEventById: jest.fn().mockReturnValue({} as MatrixEvent),
|
||||
} as unknown as EventTimelineSet);
|
||||
}) as unknown as EventTimelineSet;
|
||||
|
||||
expect(room.getEventReadUpTo(userA)).toEqual(`eventId${i}`);
|
||||
}
|
||||
@ -3328,7 +3328,7 @@ describe("Room", function () {
|
||||
({
|
||||
compareEventOrdering: () => null,
|
||||
findEventById: jest.fn().mockReturnValue({} as MatrixEvent),
|
||||
} as unknown as EventTimelineSet);
|
||||
}) as unknown as EventTimelineSet;
|
||||
room.getReadReceiptForUserId = (userId, ignore, receiptType): WrappedReceipt | null => {
|
||||
if (receiptType === ReceiptType.ReadPrivate) {
|
||||
return { eventId: "eventId1", data: { ts: i === 1 ? 2 : 1 } } as WrappedReceipt;
|
||||
@ -3348,7 +3348,7 @@ describe("Room", function () {
|
||||
({
|
||||
compareEventOrdering: () => null,
|
||||
findEventById: jest.fn().mockReturnValue({} as MatrixEvent),
|
||||
} as unknown as EventTimelineSet);
|
||||
}) as unknown as EventTimelineSet;
|
||||
room.getReadReceiptForUserId = (userId, ignore, receiptType): WrappedReceipt | null => {
|
||||
if (receiptType === ReceiptType.Read) {
|
||||
return { eventId: "eventId2", data: { ts: 1 } } as WrappedReceipt;
|
||||
@ -3366,7 +3366,7 @@ describe("Room", function () {
|
||||
({
|
||||
compareEventOrdering: () => null,
|
||||
findEventById: jest.fn().mockReturnValue({} as MatrixEvent),
|
||||
} as unknown as EventTimelineSet);
|
||||
}) as unknown as EventTimelineSet;
|
||||
});
|
||||
|
||||
it("should give precedence to m.read.private", () => {
|
||||
|
@ -484,7 +484,7 @@ describe("RustCrypto", () => {
|
||||
decryptEvent: () =>
|
||||
({
|
||||
senderCurve25519Key: "1234",
|
||||
} as IEventDecryptionResult),
|
||||
}) as IEventDecryptionResult,
|
||||
} as unknown as CryptoBackend;
|
||||
await event.attemptDecryption(mockCryptoBackend);
|
||||
|
||||
@ -524,7 +524,7 @@ describe("RustCrypto", () => {
|
||||
decryptEvent: () =>
|
||||
({
|
||||
clearEvent: { content: { body: "1234" } },
|
||||
} as unknown as IEventDecryptionResult),
|
||||
}) as unknown as IEventDecryptionResult,
|
||||
} as unknown as CryptoBackend;
|
||||
await encryptedEvent.attemptDecryption(mockCryptoBackend);
|
||||
return encryptedEvent;
|
||||
|
@ -954,7 +954,7 @@ describe("Group Call", function () {
|
||||
},
|
||||
},
|
||||
}),
|
||||
} as MatrixEvent);
|
||||
}) as MatrixEvent;
|
||||
|
||||
it("should mute remote feed's audio after receiving metadata with video audio", async () => {
|
||||
const metadataEvent = getMetadataEvent(true, false);
|
||||
@ -965,7 +965,7 @@ describe("Group Call", function () {
|
||||
|
||||
// @ts-ignore
|
||||
const call = groupCall.calls.get(FAKE_USER_ID_2)!.get(FAKE_DEVICE_ID_2)!;
|
||||
call.getOpponentMember = () => ({ userId: call.invitee } as RoomMember);
|
||||
call.getOpponentMember = () => ({ userId: call.invitee }) as RoomMember;
|
||||
// @ts-ignore Mock
|
||||
call.pushRemoteFeed(
|
||||
// @ts-ignore Mock
|
||||
@ -992,7 +992,7 @@ describe("Group Call", function () {
|
||||
|
||||
// @ts-ignore
|
||||
const call = groupCall.calls.get(FAKE_USER_ID_2).get(FAKE_DEVICE_ID_2)!;
|
||||
call.getOpponentMember = () => ({ userId: call.invitee } as RoomMember);
|
||||
call.getOpponentMember = () => ({ userId: call.invitee }) as RoomMember;
|
||||
// @ts-ignore Mock
|
||||
call.pushRemoteFeed(
|
||||
// @ts-ignore Mock
|
||||
@ -1310,7 +1310,7 @@ describe("Group Call", function () {
|
||||
|
||||
// @ts-ignore
|
||||
const call = groupCall.calls.get(FAKE_USER_ID_2)!.get(FAKE_DEVICE_ID_2)!;
|
||||
call.getOpponentMember = () => ({ userId: call.invitee } as RoomMember);
|
||||
call.getOpponentMember = () => ({ userId: call.invitee }) as RoomMember;
|
||||
call.onNegotiateReceived({
|
||||
getContent: () => ({
|
||||
[SDPStreamMetadataKey]: {
|
||||
|
Reference in New Issue
Block a user