@@ -26,7 +26,7 @@ type PaginationLinks = {
2626
2727// We see quite a few test flakes which are caused by the app exploding
2828// so we have some magic strings we check the logs for to better track the flake with its cause
29- const SPECIAL_CASES = {
29+ const SPECIAL_CASES : Record < string , string > = {
3030 "ChunkLoadError" : "ChunkLoadError" ,
3131 "Unreachable code should not be executed" : "Rust crypto panic" ,
3232 "Out of bounds memory access" : "Rust crypto memory error" ,
@@ -37,7 +37,7 @@ class FlakyReporter implements Reporter {
3737
3838 public onTestEnd ( test : TestCase ) : void {
3939 // Ignores flakes on Dendrite and Pinecone as they have their own flakes we do not track
40- if ( [ "Dendrite" , "Pinecone" ] . includes ( test . parent . project ( ) ? .name ) ) return ;
40+ if ( [ "Dendrite" , "Pinecone" ] . includes ( test . parent . project ( ) ! . name ! ) ) return ;
4141 let failures = [ `${ test . location . file . split ( "playwright/e2e/" ) [ 1 ] } : ${ test . title } ` ] ;
4242 if ( test . outcome ( ) === "flaky" ) {
4343 const timedOutRuns = test . results . filter ( ( result ) => result . status === "timedOut" ) ;
@@ -46,7 +46,7 @@ class FlakyReporter implements Reporter {
4646 ) ;
4747 // If a test failed due to a systemic fault then the test is not flaky, the app is, record it as such.
4848 const specialCases = Object . keys ( SPECIAL_CASES ) . filter ( ( log ) =>
49- pageLogs . some ( ( attachment ) => attachment . name . startsWith ( "page-" ) && attachment . body . includes ( log ) ) ,
49+ pageLogs . some ( ( attachment ) => attachment . name . startsWith ( "page-" ) && attachment . body ? .includes ( log ) ) ,
5050 ) ;
5151 if ( specialCases . length > 0 ) {
5252 failures = specialCases . map ( ( specialCase ) => SPECIAL_CASES [ specialCase ] ) ;
@@ -56,7 +56,7 @@ class FlakyReporter implements Reporter {
5656 if ( ! this . flakes . has ( title ) ) {
5757 this . flakes . set ( title , [ ] ) ;
5858 }
59- this . flakes . get ( title ) . push ( test ) ;
59+ this . flakes . get ( title ) ! . push ( test ) ;
6060 }
6161 }
6262 }
@@ -76,8 +76,8 @@ class FlakyReporter implements Reporter {
7676 if ( ! link ) return map ;
7777 const matches = link . matchAll ( / ( < (?< link > .+ ?) > ; r e l = " (?< type > .+ ?) " ) / g) ;
7878 for ( const match of matches ) {
79- const { link, type } = match . groups ;
80- map [ type ] = link ;
79+ const { link, type } = match . groups ! ;
80+ map [ type as keyof PaginationLinks ] = link ;
8181 }
8282 return map ;
8383 }
@@ -102,9 +102,9 @@ class FlakyReporter implements Reporter {
102102 issues . push ( ...fetchedIssues ) ;
103103
104104 // Get the next link for fetching more results
105- const linkHeader = issuesResponse . headers . get ( "Link" ) ;
105+ const linkHeader = issuesResponse . headers . get ( "Link" ) ! ;
106106 const parsed = this . parseLinkHeader ( linkHeader ) ;
107- url = parsed . next ;
107+ url = parsed . next ! ;
108108 }
109109 return issues ;
110110 }
0 commit comments