@@ -530,32 +530,36 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("crypto (%s)", (backend: string,
530
530
} ;
531
531
}
532
532
533
- beforeEach ( async ( ) => {
534
- // anything that we don't have a specific matcher for silently returns a 404
535
- fetchMock . catch ( 404 ) ;
536
- fetchMock . config . warnOnFallback = false ;
537
-
538
- const homeserverUrl = "https://alice-server.com" ;
539
- aliceClient = createClient ( {
540
- baseUrl : homeserverUrl ,
541
- userId : "@alice:localhost" ,
542
- accessToken : "akjgkrgjs" ,
543
- deviceId : "xzcvb" ,
544
- } ) ;
533
+ beforeEach (
534
+ async ( ) => {
535
+ // anything that we don't have a specific matcher for silently returns a 404
536
+ fetchMock . catch ( 404 ) ;
537
+ fetchMock . config . warnOnFallback = false ;
538
+
539
+ const homeserverUrl = "https://alice-server.com" ;
540
+ aliceClient = createClient ( {
541
+ baseUrl : homeserverUrl ,
542
+ userId : "@alice:localhost" ,
543
+ accessToken : "akjgkrgjs" ,
544
+ deviceId : "xzcvb" ,
545
+ } ) ;
545
546
546
- /* set up listeners for /keys/upload and /sync */
547
- keyReceiver = new E2EKeyReceiver ( homeserverUrl ) ;
548
- syncResponder = new SyncResponder ( homeserverUrl ) ;
547
+ /* set up listeners for /keys/upload and /sync */
548
+ keyReceiver = new E2EKeyReceiver ( homeserverUrl ) ;
549
+ syncResponder = new SyncResponder ( homeserverUrl ) ;
549
550
550
- await initCrypto ( aliceClient ) ;
551
+ await initCrypto ( aliceClient ) ;
551
552
552
- // create a test olm device which we will use to communicate with alice. We use libolm to implement this.
553
- await Olm . init ( ) ;
554
- testOlmAccount = new Olm . Account ( ) ;
555
- testOlmAccount . create ( ) ;
556
- const testE2eKeys = JSON . parse ( testOlmAccount . identity_keys ( ) ) ;
557
- testSenderKey = testE2eKeys . curve25519 ;
558
- } ) ;
553
+ // create a test olm device which we will use to communicate with alice. We use libolm to implement this.
554
+ await Olm . init ( ) ;
555
+ testOlmAccount = new Olm . Account ( ) ;
556
+ testOlmAccount . create ( ) ;
557
+ const testE2eKeys = JSON . parse ( testOlmAccount . identity_keys ( ) ) ;
558
+ testSenderKey = testE2eKeys . curve25519 ;
559
+ } ,
560
+ /* it can take a while to initialise the crypto library on the first pass, so bump up the timeout. */
561
+ 10000 ,
562
+ ) ;
559
563
560
564
afterEach ( async ( ) => {
561
565
await aliceClient . stopClient ( ) ;
0 commit comments