@@ -60,21 +60,15 @@ class MockWidgetApi extends EventEmitter {
6060 public requestCapabilityToSendToDevice = jest . fn ( ) ;
6161 public requestCapabilityToReceiveToDevice = jest . fn ( ) ;
6262 public sendRoomEvent = jest . fn (
63- (
64- eventType : string ,
65- content : unknown ,
66- roomId ?: string ,
67- futureTimeout ?: number ,
68- futureGroupId ?: string
69- ) =>
63+ ( eventType : string , content : unknown , roomId ?: string , futureTimeout ?: number , futureGroupId ?: string ) =>
7064 futureTimeout === undefined && futureGroupId === undefined
7165 ? { event_id : `$${ Math . random ( ) } ` }
7266 : {
7367 future_group_id : futureGroupId ?? `fg-${ Math . random ( ) } ` ,
7468 send_token : `st-${ Math . random ( ) } ` ,
7569 cancel_token : `ct-${ Math . random ( ) } ` ,
7670 refresh_token : `rt-${ Math . random ( ) } ` ,
77- }
71+ } ,
7872 ) ;
7973 public sendStateEvent = jest . fn (
8074 (
@@ -92,7 +86,7 @@ class MockWidgetApi extends EventEmitter {
9286 send_token : `st-${ Math . random ( ) } ` ,
9387 cancel_token : `ct-${ Math . random ( ) } ` ,
9488 refresh_token : `rt-${ Math . random ( ) } ` ,
95- }
89+ } ,
9690 ) ;
9791 public sendToDevice = jest . fn ( ) ;
9892 public requestOpenIDConnectToken = jest . fn ( ( ) => {
@@ -196,7 +190,7 @@ describe("RoomWidgetClient", () => {
196190 describe ( "futures" , ( ) => {
197191 describe ( "when supported" , ( ) => {
198192 const doesServerSupportUnstableFeatureMock = jest . fn ( ( feature ) =>
199- Promise . resolve ( feature === "org.matrix.msc4140" )
193+ Promise . resolve ( feature === "org.matrix.msc4140" ) ,
200194 ) ;
201195
202196 beforeAll ( ( ) => {
@@ -300,7 +294,7 @@ describe("RoomWidgetClient", () => {
300294 } ;
301295
302296 for ( const missingField of Object . keys ( response ) ) {
303- const badResponse : Record < string , string > = { ...response } ;
297+ const badResponse : Record < string , string > = { ...response } ;
304298 delete badResponse [ missingField ] ;
305299 const fullBadResponse = { ...badResponse , room_id : "!1:example.org" } ;
306300
@@ -314,7 +308,7 @@ describe("RoomWidgetClient", () => {
314308 null ,
315309 "org.matrix.rageshake_request" ,
316310 { request_id : 123 } ,
317- )
311+ ) ,
318312 ) . rejects . toThrow ( `'${ missingField } ' absent from response` ) ;
319313 } ) ;
320314
@@ -323,12 +317,12 @@ describe("RoomWidgetClient", () => {
323317 await makeClient ( { sendState : [ { eventType : "org.example.foo" , stateKey : "bar" } ] } ) ;
324318 await expect (
325319 client . _unstable_sendStateFuture (
326- "!1:example.org" ,
327- { future_timeout : 2000 , } ,
328- "org.example.foo" ,
329- { hello : "world" } ,
330- "bar" ,
331- )
320+ "!1:example.org" ,
321+ { future_timeout : 2000 } ,
322+ "org.example.foo" ,
323+ { hello : "world" } ,
324+ "bar" ,
325+ ) ,
332326 ) . rejects . toThrow ( `'${ missingField } ' absent from response` ) ;
333327 } ) ;
334328 }
@@ -345,20 +339,20 @@ describe("RoomWidgetClient", () => {
345339 null ,
346340 "org.matrix.rageshake_request" ,
347341 { request_id : 123 } ,
348- )
342+ ) ,
349343 ) . rejects . toThrow ( "Server does not support the Futures API" ) ;
350344 } ) ;
351345
352346 it ( "fails to send state futures" , async ( ) => {
353347 await makeClient ( { sendState : [ { eventType : "org.example.foo" , stateKey : "bar" } ] } ) ;
354348 await expect (
355349 client . _unstable_sendStateFuture (
356- "!1:example.org" ,
357- { future_timeout : 2000 , } ,
358- "org.example.foo" ,
359- { hello : "world" } ,
360- "bar" ,
361- )
350+ "!1:example.org" ,
351+ { future_timeout : 2000 } ,
352+ "org.example.foo" ,
353+ { hello : "world" } ,
354+ "bar" ,
355+ ) ,
362356 ) . rejects . toThrow ( "Server does not support the Futures API" ) ;
363357 } ) ;
364358 } ) ;
0 commit comments