@@ -542,19 +542,13 @@ export function gfoo() {
542
542
return expectedFiles . map ( file => [ file , host . getModifiedTime ( file ) ] as OutputFileStamp ) ;
543
543
}
544
544
545
- function verifyWatches ( host : WatchedSystem ) {
546
- verifyWatchesOfProject ( host , expectedWatchedFiles , expectedWatchedDirectoriesRecursive ) ;
547
- }
548
-
549
545
function verifyProgram ( host : WatchedSystem , watch : ( ) => BuilderProgram ) {
550
- verifyWatches ( host ) ;
551
-
546
+ verifyWatchesOfProject ( host , expectedWatchedFiles , expectedWatchedDirectoriesRecursive ) ;
547
+ checkProgramActualFiles ( watch ( ) . getProgram ( ) , expectedProgramFiles ) ;
552
548
verifyDependencies ( watch , aDts , [ aDts ] ) ;
553
- verifyDependencies ( watch , refs . path , [ refs . path ] ) ;
554
549
verifyDependencies ( watch , bDts , [ bDts , aDts ] ) ;
550
+ verifyDependencies ( watch , refs . path , [ refs . path ] ) ;
555
551
verifyDependencies ( watch , cTs . path , [ cTs . path , refs . path , bDts ] ) ;
556
-
557
- checkProgramActualFiles ( watch ( ) . getProgram ( ) , expectedProgramFiles ) ;
558
552
}
559
553
560
554
it ( "verifies dependencies and watches" , ( ) => {
@@ -577,6 +571,30 @@ export function gfoo() {
577
571
checkOutputErrorsIncremental ( host , emptyArray ) ;
578
572
verifyProgram ( host , watch ) ;
579
573
} ) ;
574
+
575
+ it ( "edit on config file" , ( ) => {
576
+ const { host, watch } = createSolutionAndWatchMode ( ) ;
577
+
578
+ const nrefs : File = {
579
+ path : getFilePathInProject ( project , "nrefs/a.d.ts" ) ,
580
+ content : refs . content
581
+ } ;
582
+ const cTsConfigJson = JSON . parse ( cTsconfig . content ) ;
583
+ host . ensureFileOrFolder ( nrefs ) ;
584
+ cTsConfigJson . compilerOptions . paths = { "@ref/*" : [ "./nrefs/*" ] } ;
585
+ host . writeFile ( cTsconfig . path , JSON . stringify ( cTsConfigJson ) ) ;
586
+
587
+ host . checkTimeoutQueueLengthAndRun ( 1 ) ;
588
+ checkOutputErrorsIncremental ( host , emptyArray ) ;
589
+
590
+ const nrefReplacer = ( f : string ) => f . replace ( "refs" , "nrefs" ) ;
591
+ verifyWatchesOfProject ( host , expectedWatchedFiles . map ( nrefReplacer ) , expectedWatchedDirectoriesRecursive . map ( nrefReplacer ) ) ;
592
+ checkProgramActualFiles ( watch ( ) . getProgram ( ) , expectedProgramFiles . map ( nrefReplacer ) ) ;
593
+ verifyDependencies ( watch , aDts , [ aDts ] ) ;
594
+ verifyDependencies ( watch , bDts , [ bDts , aDts ] ) ;
595
+ verifyDependencies ( watch , nrefs . path , [ nrefs . path ] ) ;
596
+ verifyDependencies ( watch , cTs . path , [ cTs . path , nrefs . path , bDts ] ) ;
597
+ } ) ;
580
598
} ) ;
581
599
} ) ;
582
600
} ) ;
0 commit comments