@@ -83,7 +83,7 @@ const num: number = "string"
83
83
84
84
assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
85
85
86
- const diagnosticsContent = problemMessages [ 0 ] . text
86
+ const diagnosticsContent = problemMessages [ 0 ] ? .text
87
87
assert . ok (
88
88
! diagnosticsContent ?. includes ( "Type 'string' is not assignable to type 'number'" ) &&
89
89
! diagnosticsContent ?. includes ( "unusedVar" ) &&
@@ -145,7 +145,7 @@ const num: number = "string"
145
145
146
146
assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
147
147
148
- const diagnosticsContent = problemMessages [ 0 ] . text || ""
148
+ const diagnosticsContent = problemMessages [ 0 ] ? .text || ""
149
149
150
150
// Count the number of diagnostic entries
151
151
const diagnosticMatches = diagnosticsContent . match ( / e r r o r \d + : / g) || [ ]
@@ -209,7 +209,7 @@ const num: number = "string"
209
209
210
210
assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
211
211
212
- const diagnosticsContent = problemMessages [ 0 ] . text || ""
212
+ const diagnosticsContent = problemMessages [ 0 ] ? .text || ""
213
213
214
214
// Should include diagnostics from all 3 files
215
215
for ( let i = 0 ; i < 3 ; i ++ ) {
@@ -259,7 +259,7 @@ const num: number = "string"
259
259
260
260
assert . ok ( problemMessages . length > 0 , "Should have workspace diagnostics message" )
261
261
262
- const diagnosticsContent = problemMessages [ 0 ] . text || ""
262
+ const diagnosticsContent = problemMessages [ 0 ] ? .text || ""
263
263
264
264
// Default includeDiagnosticMessages is true, so should include details
265
265
assert . ok (
0 commit comments