@@ -83,7 +83,7 @@ const num: number = "string"
8383
8484 assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
8585
86- const diagnosticsContent = problemMessages [ 0 ] . text
86+ const diagnosticsContent = problemMessages [ 0 ] ? .text
8787 assert . ok (
8888 ! diagnosticsContent ?. includes ( "Type 'string' is not assignable to type 'number'" ) &&
8989 ! diagnosticsContent ?. includes ( "unusedVar" ) &&
@@ -145,7 +145,7 @@ const num: number = "string"
145145
146146 assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
147147
148- const diagnosticsContent = problemMessages [ 0 ] . text || ""
148+ const diagnosticsContent = problemMessages [ 0 ] ? .text || ""
149149
150150 // Count the number of diagnostic entries
151151 const diagnosticMatches = diagnosticsContent . match ( / e r r o r \d + : / g) || [ ]
@@ -209,7 +209,7 @@ const num: number = "string"
209209
210210 assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
211211
212- const diagnosticsContent = problemMessages [ 0 ] . text || ""
212+ const diagnosticsContent = problemMessages [ 0 ] ? .text || ""
213213
214214 // Should include diagnostics from all 3 files
215215 for ( let i = 0 ; i < 3 ; i ++ ) {
@@ -259,7 +259,7 @@ const num: number = "string"
259259
260260 assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
261261
262- const diagnosticsContent = problemMessages [ 0 ] . text || ""
262+ const diagnosticsContent = problemMessages [ 0 ] ? .text || ""
263263
264264 // Default includeDiagnosticMessages is true, so should include details
265265 assert . ok (
0 commit comments