@@ -78,26 +78,6 @@ namespace ts {
7878 } ;
7979 }
8080
81- export function getTime ( ) {
82- let currentTime = 100 ;
83- return { tick, time, touch } ;
84-
85- function tick ( ) {
86- currentTime += 60_000 ;
87- }
88-
89- function time ( ) {
90- return currentTime ;
91- }
92-
93- function touch ( fs : vfs . FileSystem , path : string ) {
94- if ( ! fs . statSync ( path ) . isFile ( ) ) {
95- throw new Error ( `File ${ path } does not exist` ) ;
96- }
97- fs . utimesSync ( path , new Date ( time ( ) ) , new Date ( time ( ) ) ) ;
98- }
99- }
100-
10181 export const libContent = `${ TestFSWithWatch . libFile . content }
10282interface ReadonlyArray<T> {}
10383declare const console: { log(msg: any): void; };` ;
@@ -154,26 +134,6 @@ interface Symbol {
154134 fs . makeReadonly ( ) ;
155135 }
156136
157- /**
158- * Gets the FS mountuing existing fs's /src and /lib folder
159- */
160- export function getFsWithTime ( baseFs : vfs . FileSystem ) {
161- const { time, tick } = getTime ( ) ;
162- const host = new fakes . System ( baseFs ) as any as vfs . FileSystemResolverHost ;
163- host . getWorkspaceRoot = notImplemented ;
164- const resolver = vfs . createResolver ( host ) ;
165- const fs = new vfs . FileSystem ( /*ignoreCase*/ true , {
166- files : {
167- [ "/src" ] : new vfs . Mount ( "/src" , resolver ) ,
168- [ "/lib" ] : new vfs . Mount ( "/lib" , resolver )
169- } ,
170- cwd : "/" ,
171- meta : { defaultLibLocation : "/lib" } ,
172- time
173- } ) ;
174- return { fs, time, tick } ;
175- }
176-
177137 export function verifyOutputsPresent ( fs : vfs . FileSystem , outputs : readonly string [ ] ) {
178138 for ( const output of outputs ) {
179139 assert ( fs . existsSync ( output ) , `Expect file ${ output } to exist` ) ;
@@ -336,7 +296,6 @@ interface Symbol {
336296 commandLineArgs : TestTscCompile [ "commandLineArgs" ] ;
337297 modifyFs : TestTscCompile [ "modifyFs" ] ;
338298 editFs : TestTscEdit [ "modifyFs" ] ;
339- tick : ( ) => void ;
340299 baseFs : vfs . FileSystem ;
341300 newSys : TscCompileSystem ;
342301 cleanBuildDiscrepancies : TestTscEdit [ "cleanBuildDiscrepancies" ] ;
@@ -347,15 +306,14 @@ interface Symbol {
347306 const {
348307 scenario, commandLineArgs, cleanBuildDiscrepancies,
349308 modifyFs, editFs,
350- tick , baseFs, newSys
309+ baseFs, newSys
351310 } = input ( ) ;
352311 const sys = testTscCompile ( {
353312 scenario,
354313 subScenario,
355314 fs : ( ) => baseFs . makeReadonly ( ) ,
356315 commandLineArgs,
357316 modifyFs : fs => {
358- tick ( ) ;
359317 if ( modifyFs ) modifyFs ( fs ) ;
360318 editFs ( fs ) ;
361319 } ,
@@ -532,22 +490,18 @@ interface Symbol {
532490 edits
533491 } : VerifyTscWithEditsWorkerInput ) {
534492 describe ( `tsc ${ commandLineArgs . join ( " " ) } ${ scenario } :: ${ subScenario } serializedEdits` , ( ) => {
535- let tick : ( ) => void ;
536493 let sys : TscCompileSystem ;
537494 let baseFs : vfs . FileSystem ;
538495 let editsSys : TscCompileSystem [ ] ;
539496 before ( ( ) => {
540497 Debug . assert ( ! ! edits . length , `${ scenario } /${ subScenario } :: No incremental scenarios, you probably want to use verifyTsc instead.` ) ;
541- ( { fs : baseFs , tick } = getFsWithTime ( fs ( ) ) ) ;
498+ baseFs = fs ( ) . makeReadonly ( ) ;
542499 sys = testTscCompile ( {
543500 scenario,
544501 subScenario,
545- fs : ( ) => baseFs . makeReadonly ( ) ,
502+ fs : ( ) => baseFs ,
546503 commandLineArgs,
547- modifyFs : fs => {
548- if ( modifyFs ) modifyFs ( fs ) ;
549- tick ( ) ;
550- } ,
504+ modifyFs,
551505 baselineSourceMap,
552506 baselineReadFileCalls,
553507 baselinePrograms
@@ -556,18 +510,13 @@ interface Symbol {
556510 { modifyFs, subScenario : editScenario , commandLineArgs : editCommandLineArgs } ,
557511 index
558512 ) => {
559- tick ( ) ;
560513 ( editsSys || ( editsSys = [ ] ) ) . push ( testTscCompile ( {
561514 scenario,
562515 subScenario : editScenario || subScenario ,
563516 diffWithInitial : true ,
564517 fs : ( ) => index === 0 ? sys . vfs : editsSys [ index - 1 ] . vfs ,
565518 commandLineArgs : editCommandLineArgs || commandLineArgs ,
566- modifyFs : fs => {
567- tick ( ) ;
568- modifyFs ( fs ) ;
569- tick ( ) ;
570- } ,
519+ modifyFs,
571520 baselineSourceMap,
572521 baselineReadFileCalls,
573522 baselinePrograms
@@ -577,7 +526,6 @@ interface Symbol {
577526 after ( ( ) => {
578527 baseFs = undefined ! ;
579528 sys = undefined ! ;
580- tick = undefined ! ;
581529 editsSys = undefined ! ;
582530 } ) ;
583531 describe ( "tsc invocation after edit" , ( ) => {
@@ -608,7 +556,6 @@ interface Symbol {
608556 }
609557 } ,
610558 modifyFs,
611- tick
612559 } ) , index , subScenario ) ) ;
613560 } ) ;
614561 } ) ;
0 commit comments