@@ -268,6 +268,51 @@ namespace ts {
268
268
[ Diagnostics . Building_project_0 , "/src/tests/tsconfig.json" ]
269
269
) ;
270
270
} ) ;
271
+
272
+ it ( "rebuilds when tsconfig changes" , ( ) => {
273
+ const { fs, host, builder } = initializeWithBuild ( ) ;
274
+ replaceText ( fs , "/src/tests/tsconfig.json" , `"composite": true` , `"composite": true, "target": "es3"` ) ;
275
+ builder . buildAllProjects ( ) ;
276
+ host . assertDiagnosticMessages (
277
+ getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/logic/tsconfig.json" , "src/tests/tsconfig.json" ) ,
278
+ [ Diagnostics . Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2 , "src/core/tsconfig.json" , "src/core/anotherModule.ts" , "src/core/anotherModule.js" ] ,
279
+ [ Diagnostics . Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2 , "src/logic/tsconfig.json" , "src/logic/index.ts" , "src/logic/index.js" ] ,
280
+ [ Diagnostics . Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2 , "src/tests/tsconfig.json" , "src/tests/index.js" , "src/tests/tsconfig.json" ] ,
281
+ [ Diagnostics . Building_project_0 , "/src/tests/tsconfig.json" ] ,
282
+ [ Diagnostics . Updating_unchanged_output_timestamps_of_project_0 , "/src/tests/tsconfig.json" ]
283
+ ) ;
284
+ } ) ;
285
+
286
+ it ( "rebuilds when extended config file changes" , ( ) => {
287
+ const fs = projFs . shadow ( ) ;
288
+ fs . writeFileSync ( "/src/tests/tsconfig.base.json" , JSON . stringify ( { compilerOptions : { target : "es3" } } ) ) ;
289
+ replaceText ( fs , "/src/tests/tsconfig.json" , `"references": [` , `"extends": "./tsconfig.base.json", "references": [` ) ;
290
+ const host = new fakes . SolutionBuilderHost ( fs ) ;
291
+ const builder = createSolutionBuilder ( host , [ "/src/tests" ] , { verbose : true } ) ;
292
+ builder . buildAllProjects ( ) ;
293
+ host . assertDiagnosticMessages (
294
+ getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/logic/tsconfig.json" , "src/tests/tsconfig.json" ) ,
295
+ [ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/core/tsconfig.json" , "src/core/anotherModule.js" ] ,
296
+ [ Diagnostics . Building_project_0 , "/src/core/tsconfig.json" ] ,
297
+ [ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/logic/tsconfig.json" , "src/logic/index.js" ] ,
298
+ [ Diagnostics . Building_project_0 , "/src/logic/tsconfig.json" ] ,
299
+ [ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/tests/tsconfig.json" , "src/tests/index.js" ] ,
300
+ [ Diagnostics . Building_project_0 , "/src/tests/tsconfig.json" ]
301
+ ) ;
302
+ host . clearDiagnostics ( ) ;
303
+ tick ( ) ;
304
+ builder . resetBuildContext ( ) ;
305
+ fs . writeFileSync ( "/src/tests/tsconfig.base.json" , JSON . stringify ( { compilerOptions : { } } ) ) ;
306
+ builder . buildAllProjects ( ) ;
307
+ host . assertDiagnosticMessages (
308
+ getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/logic/tsconfig.json" , "src/tests/tsconfig.json" ) ,
309
+ [ Diagnostics . Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2 , "src/core/tsconfig.json" , "src/core/anotherModule.ts" , "src/core/anotherModule.js" ] ,
310
+ [ Diagnostics . Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2 , "src/logic/tsconfig.json" , "src/logic/index.ts" , "src/logic/index.js" ] ,
311
+ [ Diagnostics . Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2 , "src/tests/tsconfig.json" , "src/tests/index.js" , "src/tests/tsconfig.base.json" ] ,
312
+ [ Diagnostics . Building_project_0 , "/src/tests/tsconfig.json" ] ,
313
+ [ Diagnostics . Updating_unchanged_output_timestamps_of_project_0 , "/src/tests/tsconfig.json" ]
314
+ ) ;
315
+ } ) ;
271
316
} ) ;
272
317
273
318
describe ( "downstream-blocked compilations" , ( ) => {
0 commit comments