@@ -197,13 +197,13 @@ namespace ts {
197
197
const caseSensitiveBasePath = "/dev/" ;
198
198
const caseSensitiveHost = new fakes . ParseConfigHost ( createFileSystem ( /*ignoreCase*/ false , caseSensitiveBasePath , "/" ) ) ;
199
199
200
- function verifyDiagnostics ( actual : Diagnostic [ ] , expected : { code : number , category : DiagnosticCategory , messageText : string } [ ] ) {
200
+ function verifyDiagnostics ( actual : Diagnostic [ ] , expected : { code : number ; messageText : string ; } [ ] ) {
201
201
assert . isTrue ( expected . length === actual . length , `Expected error: ${ JSON . stringify ( expected ) } . Actual error: ${ JSON . stringify ( actual ) } .` ) ;
202
202
for ( let i = 0 ; i < actual . length ; i ++ ) {
203
203
const actualError = actual [ i ] ;
204
204
const expectedError = expected [ i ] ;
205
205
assert . equal ( actualError . code , expectedError . code , "Error code mismatch" ) ;
206
- assert . equal ( actualError . category , expectedError . category , "Category mismatch" ) ;
206
+ assert . equal ( actualError . category , DiagnosticCategory . Error , "Category mismatch" ) ; // Should always be error
207
207
assert . equal ( flattenDiagnosticMessageText ( actualError . messageText , "\n" ) , expectedError . messageText ) ;
208
208
}
209
209
}
@@ -246,7 +246,7 @@ namespace ts {
246
246
} ) ;
247
247
}
248
248
249
- function testFailure ( name : string , entry : string , expectedDiagnostics : { code : number , category : DiagnosticCategory , messageText : string } [ ] ) {
249
+ function testFailure ( name : string , entry : string , expectedDiagnostics : { code : number ; messageText : string ; } [ ] ) {
250
250
it ( name , ( ) => {
251
251
const parsed = getParseCommandLine ( entry ) ;
252
252
verifyDiagnostics ( parsed . errors , expectedDiagnostics ) ;
@@ -280,26 +280,22 @@ namespace ts {
280
280
testFailure ( "can report errors on circular imports" , "circular.json" , [
281
281
{
282
282
code : 18000 ,
283
- category : DiagnosticCategory . Error ,
284
283
messageText : `Circularity detected while resolving configuration: ${ [ combinePaths ( basePath , "circular.json" ) , combinePaths ( basePath , "circular2.json" ) , combinePaths ( basePath , "circular.json" ) ] . join ( " -> " ) } `
285
284
}
286
285
] ) ;
287
286
288
287
testFailure ( "can report missing configurations" , "missing.json" , [ {
289
- code : 6096 ,
290
- category : DiagnosticCategory . Message ,
291
- messageText : `File './missing2' does not exist.`
288
+ code : 6053 ,
289
+ messageText : `File './missing2' not found.`
292
290
} ] ) ;
293
291
294
292
testFailure ( "can report errors in extended configs" , "failure.json" , [ {
295
293
code : 6114 ,
296
- category : DiagnosticCategory . Error ,
297
294
messageText : `Unknown option 'excludes'. Did you mean 'exclude'?`
298
295
} ] ) ;
299
296
300
297
testFailure ( "can error when 'extends' is not a string" , "extends.json" , [ {
301
298
code : 5024 ,
302
- category : DiagnosticCategory . Error ,
303
299
messageText : `Compiler option 'extends' requires a value of type string.`
304
300
} ] ) ;
305
301
0 commit comments