@@ -78,26 +78,6 @@ namespace ts {
78
78
} ;
79
79
}
80
80
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
-
101
81
export const libContent = `${ TestFSWithWatch . libFile . content }
102
82
interface ReadonlyArray<T> {}
103
83
declare const console: { log(msg: any): void; };` ;
@@ -154,26 +134,6 @@ interface Symbol {
154
134
fs . makeReadonly ( ) ;
155
135
}
156
136
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
-
177
137
export function verifyOutputsPresent ( fs : vfs . FileSystem , outputs : readonly string [ ] ) {
178
138
for ( const output of outputs ) {
179
139
assert ( fs . existsSync ( output ) , `Expect file ${ output } to exist` ) ;
@@ -336,7 +296,6 @@ interface Symbol {
336
296
commandLineArgs : TestTscCompile [ "commandLineArgs" ] ;
337
297
modifyFs : TestTscCompile [ "modifyFs" ] ;
338
298
editFs : TestTscEdit [ "modifyFs" ] ;
339
- tick : ( ) => void ;
340
299
baseFs : vfs . FileSystem ;
341
300
newSys : TscCompileSystem ;
342
301
cleanBuildDiscrepancies : TestTscEdit [ "cleanBuildDiscrepancies" ] ;
@@ -347,15 +306,14 @@ interface Symbol {
347
306
const {
348
307
scenario, commandLineArgs, cleanBuildDiscrepancies,
349
308
modifyFs, editFs,
350
- tick , baseFs, newSys
309
+ baseFs, newSys
351
310
} = input ( ) ;
352
311
const sys = testTscCompile ( {
353
312
scenario,
354
313
subScenario,
355
314
fs : ( ) => baseFs . makeReadonly ( ) ,
356
315
commandLineArgs,
357
316
modifyFs : fs => {
358
- tick ( ) ;
359
317
if ( modifyFs ) modifyFs ( fs ) ;
360
318
editFs ( fs ) ;
361
319
} ,
@@ -532,22 +490,18 @@ interface Symbol {
532
490
edits
533
491
} : VerifyTscWithEditsWorkerInput ) {
534
492
describe ( `tsc ${ commandLineArgs . join ( " " ) } ${ scenario } :: ${ subScenario } serializedEdits` , ( ) => {
535
- let tick : ( ) => void ;
536
493
let sys : TscCompileSystem ;
537
494
let baseFs : vfs . FileSystem ;
538
495
let editsSys : TscCompileSystem [ ] ;
539
496
before ( ( ) => {
540
497
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 ( ) ;
542
499
sys = testTscCompile ( {
543
500
scenario,
544
501
subScenario,
545
- fs : ( ) => baseFs . makeReadonly ( ) ,
502
+ fs : ( ) => baseFs ,
546
503
commandLineArgs,
547
- modifyFs : fs => {
548
- if ( modifyFs ) modifyFs ( fs ) ;
549
- tick ( ) ;
550
- } ,
504
+ modifyFs,
551
505
baselineSourceMap,
552
506
baselineReadFileCalls,
553
507
baselinePrograms
@@ -556,18 +510,13 @@ interface Symbol {
556
510
{ modifyFs, subScenario : editScenario , commandLineArgs : editCommandLineArgs } ,
557
511
index
558
512
) => {
559
- tick ( ) ;
560
513
( editsSys || ( editsSys = [ ] ) ) . push ( testTscCompile ( {
561
514
scenario,
562
515
subScenario : editScenario || subScenario ,
563
516
diffWithInitial : true ,
564
517
fs : ( ) => index === 0 ? sys . vfs : editsSys [ index - 1 ] . vfs ,
565
518
commandLineArgs : editCommandLineArgs || commandLineArgs ,
566
- modifyFs : fs => {
567
- tick ( ) ;
568
- modifyFs ( fs ) ;
569
- tick ( ) ;
570
- } ,
519
+ modifyFs,
571
520
baselineSourceMap,
572
521
baselineReadFileCalls,
573
522
baselinePrograms
@@ -577,7 +526,6 @@ interface Symbol {
577
526
after ( ( ) => {
578
527
baseFs = undefined ! ;
579
528
sys = undefined ! ;
580
- tick = undefined ! ;
581
529
editsSys = undefined ! ;
582
530
} ) ;
583
531
describe ( "tsc invocation after edit" , ( ) => {
@@ -608,7 +556,6 @@ interface Symbol {
608
556
}
609
557
} ,
610
558
modifyFs,
611
- tick
612
559
} ) , index , subScenario ) ) ;
613
560
} ) ;
614
561
} ) ;
0 commit comments