@@ -236,6 +236,58 @@ const a: string = 10;`, "utf-8"),
236
236
}
237
237
} ) ;
238
238
239
+ verifyTscSerializedIncrementalEdits ( {
240
+ scenario : "incremental" ,
241
+ subScenario : `when global file is added, the signatures are updated` ,
242
+ fs : ( ) => loadProjectFromFiles ( {
243
+ "/src/project/src/main.ts" : Utils . dedent `
244
+ /// <reference path="./filePresent.ts"/>
245
+ /// <reference path="./fileNotFound.ts"/>
246
+ function main() { }
247
+ ` ,
248
+ "/src/project/src/anotherFileWithSameReferenes.ts" : Utils . dedent `
249
+ /// <reference path="./filePresent.ts"/>
250
+ /// <reference path="./fileNotFound.ts"/>
251
+ function anotherFileWithSameReferenes() { }
252
+ ` ,
253
+ "/src/project/src/filePresent.ts" : `function something() { return 10; }` ,
254
+ "/src/project/tsconfig.json" : JSON . stringify ( {
255
+ compilerOptions : { composite : true , } ,
256
+ include : [ "src/**/*.ts" ]
257
+ } ) ,
258
+ } ) ,
259
+ commandLineArgs : [ "--p" , "src/project" ] ,
260
+ incrementalScenarios : [
261
+ noChangeRun ,
262
+ {
263
+ subScenario : "Modify main file" ,
264
+ buildKind : BuildKind . IncrementalDtsChange ,
265
+ modifyFs : fs => appendText ( fs , `/src/project/src/main.ts` , `something();` ) ,
266
+ } ,
267
+ {
268
+ subScenario : "Add new file and update main file" ,
269
+ buildKind : BuildKind . IncrementalDtsChange ,
270
+ modifyFs : fs => {
271
+ fs . writeFileSync ( `/src/project/src/newFile.ts` , "function foo() { return 20; }" ) ;
272
+ prependText ( fs , `/src/project/src/main.ts` , `/// <reference path="./newFile.ts"/>
273
+ ` ) ;
274
+ appendText ( fs , `/src/project/src/main.ts` , `foo();` ) ;
275
+ } ,
276
+ } ,
277
+ {
278
+ subScenario : "Write file that could not be resolved" ,
279
+ buildKind : BuildKind . IncrementalDtsChange ,
280
+ modifyFs : fs => fs . writeFileSync ( `/src/project/src/fileNotFound.ts` , "function something2() { return 20; }" ) ,
281
+ } ,
282
+ {
283
+ subScenario : "Modify main file" ,
284
+ buildKind : BuildKind . IncrementalDtsChange ,
285
+ modifyFs : fs => appendText ( fs , `/src/project/src/main.ts` , `something();` ) ,
286
+ } ,
287
+ ] ,
288
+ baselinePrograms : true ,
289
+ } ) ;
290
+
239
291
const jsxLibraryContent = `
240
292
export {};
241
293
declare global {
0 commit comments