@@ -368,7 +368,7 @@ describe("MatrixClient event timelines", function() {
368368 expect ( tl ! . getEvents ( ) . length ) . toEqual ( 4 ) ;
369369 for ( let i = 0 ; i < 4 ; i ++ ) {
370370 expect ( tl ! . getEvents ( ) [ i ] . event ) . toEqual ( EVENTS [ i ] ) ;
371- expect ( tl ! . getEvents ( ) [ i ] ?. sender . name ) . toEqual ( userName ) ;
371+ expect ( tl ! . getEvents ( ) [ i ] ?. sender ? .name ) . toEqual ( userName ) ;
372372 }
373373 expect ( tl ! . getPaginationToken ( EventTimeline . BACKWARDS ) )
374374 . toEqual ( "start_token" ) ;
@@ -406,7 +406,7 @@ describe("MatrixClient event timelines", function() {
406406 } ) . then ( function ( tl ) {
407407 expect ( tl ! . getEvents ( ) . length ) . toEqual ( 2 ) ;
408408 expect ( tl ! . getEvents ( ) [ 1 ] . event ) . toEqual ( EVENTS [ 0 ] ) ;
409- expect ( tl ! . getEvents ( ) [ 1 ] ?. sender . name ) . toEqual ( userName ) ;
409+ expect ( tl ! . getEvents ( ) [ 1 ] ?. sender ? .name ) . toEqual ( userName ) ;
410410 expect ( tl ! . getPaginationToken ( EventTimeline . BACKWARDS ) )
411411 . toEqual ( "f_1_1" ) ;
412412 // expect(tl.getPaginationToken(EventTimeline.FORWARDS))
@@ -767,8 +767,8 @@ describe("MatrixClient event timelines", function() {
767767 httpBackend = testClient . httpBackend ;
768768 await startClient ( httpBackend , client ) ;
769769
770- const room = client . getRoom ( roomId ) ;
771- const timelineSet = room . getTimelineSets ( ) [ 0 ] ;
770+ const room = client . getRoom ( roomId ) ! ;
771+ const timelineSet = room . getTimelineSets ( ) [ 0 ] ! ;
772772 await expect ( client . getLatestTimeline ( timelineSet ) ) . rejects . toBeTruthy ( ) ;
773773 } ) ;
774774
@@ -786,7 +786,7 @@ describe("MatrixClient event timelines", function() {
786786 httpBackend = testClient . httpBackend ;
787787
788788 return startClient ( httpBackend , client ) . then ( ( ) => {
789- const room = client . getRoom ( roomId ) ;
789+ const room = client . getRoom ( roomId ) ! ;
790790 const timelineSet = room . getTimelineSets ( ) [ 0 ] ;
791791 expect ( client . getLatestTimeline ( timelineSet ) ) . rejects . toBeFalsy ( ) ;
792792 } ) ;
@@ -849,7 +849,7 @@ describe("MatrixClient event timelines", function() {
849849 expect ( tl ! . getEvents ( ) . length ) . toEqual ( 4 ) ;
850850 for ( let i = 0 ; i < 4 ; i ++ ) {
851851 expect ( tl ! . getEvents ( ) [ i ] . event ) . toEqual ( EVENTS [ i ] ) ;
852- expect ( tl ! . getEvents ( ) [ i ] ?. sender . name ) . toEqual ( userName ) ;
852+ expect ( tl ! . getEvents ( ) [ i ] ?. sender ? .name ) . toEqual ( userName ) ;
853853 }
854854 expect ( tl ! . getPaginationToken ( EventTimeline . BACKWARDS ) )
855855 . toEqual ( "start_token" ) ;
@@ -1129,8 +1129,8 @@ describe("MatrixClient event timelines", function() {
11291129 } ) ;
11301130
11311131 it ( "should allow fetching all threads" , async function ( ) {
1132- const room = client . getRoom ( roomId ) ;
1133- const timelineSets = await room ? .createThreadsTimelineSets ( ) ;
1132+ const room = client . getRoom ( roomId ) ! ;
1133+ const timelineSets = await room . createThreadsTimelineSets ( ) ;
11341134 expect ( timelineSets ) . not . toBeNull ( ) ;
11351135 respondToThreads ( ) ;
11361136 respondToThreads ( ) ;
@@ -1185,14 +1185,14 @@ describe("MatrixClient event timelines", function() {
11851185 } ) ;
11861186
11871187 it ( "should allow fetching all threads" , async function ( ) {
1188- const room = client . getRoom ( roomId ) ;
1188+ const room = client . getRoom ( roomId ) ! ;
11891189
11901190 respondToFilter ( ) ;
11911191 respondToSync ( ) ;
11921192 respondToFilter ( ) ;
11931193 respondToSync ( ) ;
11941194
1195- const timelineSetsPromise = room ? .createThreadsTimelineSets ( ) ;
1195+ const timelineSetsPromise = room . createThreadsTimelineSets ( ) ;
11961196 expect ( timelineSetsPromise ) . not . toBeNull ( ) ;
11971197 await flushHttp ( timelineSetsPromise ! ) ;
11981198 respondToFilter ( ) ;
@@ -1218,7 +1218,7 @@ describe("MatrixClient event timelines", function() {
12181218 const [ allThreads ] = timelineSets ! ;
12191219
12201220 respondToThreads ( ) . check ( ( request ) => {
1221- expect ( request . queryParams . filter ) . toEqual ( JSON . stringify ( {
1221+ expect ( request . queryParams ? .filter ) . toEqual ( JSON . stringify ( {
12221222 "lazy_load_members" : true ,
12231223 } ) ) ;
12241224 } ) ;
@@ -1244,7 +1244,7 @@ describe("MatrixClient event timelines", function() {
12441244 state : [ ] ,
12451245 next_batch : null ,
12461246 } ) . check ( ( request ) => {
1247- expect ( request . queryParams . from ) . toEqual ( RANDOM_TOKEN ) ;
1247+ expect ( request . queryParams ? .from ) . toEqual ( RANDOM_TOKEN ) ;
12481248 } ) ;
12491249
12501250 allThreads . getLiveTimeline ( ) . setPaginationToken ( RANDOM_TOKEN , Direction . Backward ) ;
0 commit comments