@@ -2,9 +2,9 @@ namespace ts {
2
2
describe ( "unittests:: tsbuild:: on 'sample1' project" , ( ) => {
3
3
let projFs : vfs . FileSystem ;
4
4
const { time, tick } = getTime ( ) ;
5
- const testsOutputs = [ "/src/tests/index.js" ] ;
6
- const logicOutputs = [ "/src/logic/index.js" , "/src/logic/index.js.map" , "/src/logic/index.d.ts" ] ;
7
- const coreOutputs = [ "/src/core/index.js" , "/src/core/index.d.ts" , "/src/core/index.d.ts.map" ] ;
5
+ const testsOutputs = [ "/src/tests/index.js" , "/src/tests/index.d.ts" , "/src/tests/tsconfig.tsbuildinfo" ] ;
6
+ const logicOutputs = [ "/src/logic/index.js" , "/src/logic/index.js.map" , "/src/logic/index.d.ts" , "/src/logic/tsconfig.tsbuildinfo" ] ;
7
+ const coreOutputs = [ "/src/core/index.js" , "/src/core/index.d.ts" , "/src/core/index.d.ts.map" , "/src/core/tsconfig.tsbuildinfo" ] ;
8
8
const allExpectedOutputs = [ ...testsOutputs , ...logicOutputs , ...coreOutputs ] ;
9
9
10
10
before ( ( ) => {
@@ -272,6 +272,35 @@ namespace ts {
272
272
) ;
273
273
} ) ;
274
274
275
+ it ( "does not rebuild if there is no program and bundle in the ts build info event if version doesnt match ts version" , ( ) => {
276
+ const fs = projFs . shadow ( ) ;
277
+ const host = new fakes . SolutionBuilderHost ( fs , /*options*/ undefined , /*setParentNodes*/ undefined , createAbstractBuilder ) ;
278
+ let builder = createSolutionBuilder ( host , [ "/src/tests" ] , { verbose : true } ) ;
279
+ builder . build ( ) ;
280
+ host . assertDiagnosticMessages (
281
+ getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/logic/tsconfig.json" , "src/tests/tsconfig.json" ) ,
282
+ [ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/core/tsconfig.json" , "src/core/anotherModule.js" ] ,
283
+ [ Diagnostics . Building_project_0 , "/src/core/tsconfig.json" ] ,
284
+ [ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/logic/tsconfig.json" , "src/logic/index.js" ] ,
285
+ [ Diagnostics . Building_project_0 , "/src/logic/tsconfig.json" ] ,
286
+ [ Diagnostics . Project_0_is_out_of_date_because_output_file_1_does_not_exist , "src/tests/tsconfig.json" , "src/tests/index.js" ] ,
287
+ [ Diagnostics . Building_project_0 , "/src/tests/tsconfig.json" ]
288
+ ) ;
289
+ verifyOutputsPresent ( fs , allExpectedOutputs ) ;
290
+
291
+ host . clearDiagnostics ( ) ;
292
+ tick ( ) ;
293
+ builder = createSolutionBuilder ( host , [ "/src/tests" ] , { verbose : true } ) ;
294
+ changeCompilerVersion ( host ) ;
295
+ builder . build ( ) ;
296
+ host . assertDiagnosticMessages (
297
+ getExpectedDiagnosticForProjectsInBuild ( "src/core/tsconfig.json" , "src/logic/tsconfig.json" , "src/tests/tsconfig.json" ) ,
298
+ [ 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" ] ,
299
+ [ 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" ] ,
300
+ [ Diagnostics . Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2 , "src/tests/tsconfig.json" , "src/tests/index.ts" , "src/tests/index.js" ]
301
+ ) ;
302
+ } ) ;
303
+
275
304
it ( "rebuilds from start if --f is passed" , ( ) => {
276
305
const { host, builder } = initializeWithBuild ( { force : true } ) ;
277
306
builder . build ( ) ;
0 commit comments