@@ -42,7 +42,7 @@ namespace ts {
42
42
interface VerifyBuild {
43
43
modifyDiskLayout : ( fs : vfs . FileSystem ) => void ;
44
44
expectedExitStatus : ExitStatus ;
45
- expectedDiagnostics : fakes . ExpectedDiagnostic [ ] ;
45
+ expectedDiagnostics : ( fs : vfs . FileSystem ) => fakes . ExpectedDiagnostic [ ] ;
46
46
expectedOutputs : readonly string [ ] ;
47
47
notExpectedOutputs : readonly string [ ] ;
48
48
}
@@ -54,7 +54,7 @@ namespace ts {
54
54
const builder = createSolutionBuilder ( host , [ "/src/tsconfig.json" ] , { verbose : true } ) ;
55
55
const exitStatus = builder . build ( ) ;
56
56
assert . equal ( exitStatus , expectedExitStatus ) ;
57
- host . assertDiagnosticMessages ( ...expectedDiagnostics ) ;
57
+ host . assertDiagnosticMessages ( ...expectedDiagnostics ( fs ) ) ;
58
58
verifyOutputsPresent ( fs , expectedOutputs ) ;
59
59
verifyOutputsAbsent ( fs , notExpectedOutputs ) ;
60
60
}
@@ -63,7 +63,7 @@ namespace ts {
63
63
verifyBuild ( {
64
64
modifyDiskLayout : noop ,
65
65
expectedExitStatus : ExitStatus . Success ,
66
- expectedDiagnostics : [
66
+ expectedDiagnostics : ( ) => [
67
67
getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/animals/tsconfig.json" , "src/zoo/tsconfig.json" , "src/tsconfig.json" ) ,
68
68
[ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/core/tsconfig.json" , "src/lib/core/utilities.js" ] ,
69
69
[ Diagnostics . Building_project_0 , "/src/core/tsconfig.json" ] ,
@@ -91,7 +91,7 @@ namespace ts {
91
91
]`
92
92
) ,
93
93
expectedExitStatus : ExitStatus . ProjectReferenceCycle_OutputsSkupped ,
94
- expectedDiagnostics : [
94
+ expectedDiagnostics : ( ) => [
95
95
getExpectedDiagnosticForProjectsInBuild ( "src/animals/tsconfig.json" , "src/zoo/tsconfig.json" , "src/core/tsconfig.json" , "src/tsconfig.json" ) ,
96
96
errorDiagnostic ( [
97
97
Diagnostics . Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0 ,
@@ -117,16 +117,38 @@ namespace ts {
117
117
`
118
118
) ,
119
119
expectedExitStatus : ExitStatus . DiagnosticsPresent_OutputsSkipped ,
120
- expectedDiagnostics : [
120
+ expectedDiagnostics : fs => [
121
121
getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/animals/tsconfig.json" , "src/zoo/tsconfig.json" , "src/tsconfig.json" ) ,
122
122
[ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/core/tsconfig.json" , "src/lib/core/utilities.js" ] ,
123
123
[ Diagnostics . Building_project_0 , "/src/core/tsconfig.json" ] ,
124
- errorDiagnostic ( [ Diagnostics . File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files , "/src/animals/animal.ts" , "/src/core" ] ) ,
125
- errorDiagnostic ( [ Diagnostics . File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files , "/src/animals/dog.ts" , "/src/core" ] ) ,
126
- errorDiagnostic ( [ Diagnostics . File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files , "/src/animals/index.ts" , "/src/core" ] ) ,
127
- errorDiagnostic ( [ Diagnostics . File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern , "/src/animals/animal.ts" , "/src/core/tsconfig.json" ] ) ,
128
- errorDiagnostic ( [ Diagnostics . File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern , "/src/animals/dog.ts" , "/src/core/tsconfig.json" ] ) ,
129
- errorDiagnostic ( [ Diagnostics . File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern , "/src/animals/index.ts" , "/src/core/tsconfig.json" ] ) ,
124
+ {
125
+ message : [ Diagnostics . File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files , "/src/animals/animal.ts" , "/src/core" ] ,
126
+ location : expectedLocationIndexOf ( fs , "/src/animals/index.ts" , `'./animal'` ) ,
127
+ } ,
128
+ {
129
+ message : [ Diagnostics . File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern , "/src/animals/animal.ts" , "/src/core/tsconfig.json" ] ,
130
+ location : expectedLocationIndexOf ( fs , "/src/animals/index.ts" , `'./animal'` ) ,
131
+ } ,
132
+ {
133
+ message : [ Diagnostics . File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files , "/src/animals/dog.ts" , "/src/core" ] ,
134
+ location : expectedLocationIndexOf ( fs , "/src/animals/index.ts" , `'./dog'` ) ,
135
+ } ,
136
+ {
137
+ message : [ Diagnostics . File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern , "/src/animals/dog.ts" , "/src/core/tsconfig.json" ] ,
138
+ location : expectedLocationIndexOf ( fs , "/src/animals/index.ts" , `'./dog'` ) ,
139
+ } ,
140
+ {
141
+ message : [ Diagnostics . _0_is_declared_but_its_value_is_never_read , "A" ] ,
142
+ location : expectedLocationIndexOf ( fs , "/src/core/utilities.ts" , `import * as A from '../animals';` ) ,
143
+ } ,
144
+ {
145
+ message : [ Diagnostics . File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files , "/src/animals/index.ts" , "/src/core" ] ,
146
+ location : expectedLocationIndexOf ( fs , "/src/core/utilities.ts" , `'../animals'` ) ,
147
+ } ,
148
+ {
149
+ message : [ Diagnostics . File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern , "/src/animals/index.ts" , "/src/core/tsconfig.json" ] ,
150
+ location : expectedLocationIndexOf ( fs , "/src/core/utilities.ts" , `'../animals'` ) ,
151
+ } ,
130
152
[ Diagnostics . Project_0_can_t_be_built_because_its_dependency_1_has_errors , "src/animals/tsconfig.json" , "src/core" ] ,
131
153
[ Diagnostics . Skipping_build_of_project_0_because_its_dependency_1_has_errors , "/src/animals/tsconfig.json" , "/src/core" ] ,
132
154
[ Diagnostics . Project_0_can_t_be_built_because_its_dependency_1_was_not_built , "src/zoo/tsconfig.json" , "src/animals" ] ,
0 commit comments