@@ -14,6 +14,7 @@ import {
14
14
libFile ,
15
15
SymLink ,
16
16
TestServerHost ,
17
+ TestServerHostOsFlavor ,
17
18
Tsc_WatchDirectory ,
18
19
Tsc_WatchFile ,
19
20
} from "../helpers/virtualFileSystemWithWatch" ;
@@ -162,7 +163,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
162
163
const files = [ file , configFile , libFile ] ;
163
164
const environmentVariables = new Map < string , string > ( ) ;
164
165
environmentVariables . set ( "TSC_WATCHDIRECTORY" , tscWatchDirectory ) ;
165
- return createWatchedSystem ( files , { environmentVariables } ) ;
166
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux , environmentVariables } ) ;
166
167
} ,
167
168
edits : [
168
169
{
@@ -230,7 +231,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
230
231
const files = [ libFile , file1 , tsconfig , realA , realB , symLinkA , symLinkB , symLinkBInA , symLinkAInB ] ;
231
232
const environmentVariables = new Map < string , string > ( ) ;
232
233
environmentVariables . set ( "TSC_WATCHDIRECTORY" , Tsc_WatchDirectory . NonRecursiveWatchDirectory ) ;
233
- return createWatchedSystem ( files , { environmentVariables, currentDirectory : cwd } ) ;
234
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux , environmentVariables, currentDirectory : cwd } ) ;
234
235
} ,
235
236
} ) ;
236
237
@@ -252,7 +253,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
252
253
content : `export const x = 10;` ,
253
254
} ;
254
255
const files = [ libFile , file1 , file2 , configFile ] ;
255
- return createWatchedSystem ( files , { runWithoutRecursiveWatches : true } ) ;
256
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux } ) ;
256
257
} ,
257
258
edits : [
258
259
{
@@ -330,7 +331,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
330
331
content : `export const x = 10;` ,
331
332
} ;
332
333
const files = [ libFile , file1 , file2 , configFile ] ;
333
- return createWatchedSystem ( files , { runWithoutRecursiveWatches : true } ) ;
334
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux } ) ;
334
335
} ,
335
336
edits : [
336
337
noopChange ,
@@ -371,7 +372,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
371
372
content : `export const x = 10;` ,
372
373
} ;
373
374
const files = [ libFile , file1 , file2 , configFile ] ;
374
- return createWatchedSystem ( files , { runWithoutRecursiveWatches : true } ) ;
375
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux } ) ;
375
376
} ,
376
377
edits : [
377
378
noopChange ,
@@ -427,7 +428,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
427
428
} ) ,
428
429
} ;
429
430
const files = [ libFile , commonFile1 , commonFile2 , configFile ] ;
430
- return createWatchedSystem ( files , { runWithoutRecursiveWatches : true } ) ;
431
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux } ) ;
431
432
} ,
432
433
} ) ;
433
434
@@ -445,7 +446,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
445
446
} ) ,
446
447
} ;
447
448
const files = [ libFile , commonFile1 , commonFile2 , configFile ] ;
448
- return createWatchedSystem ( files , { runWithoutRecursiveWatches : true , runWithFallbackPolling : true } ) ;
449
+ return createWatchedSystem ( files , { osFlavor : TestServerHostOsFlavor . Linux , runWithFallbackPolling : true } ) ;
449
450
} ,
450
451
} ) ;
451
452
@@ -464,7 +465,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
464
465
} ) ;
465
466
466
467
describe ( "exclude options" , ( ) => {
467
- function sys ( watchOptions : ts . WatchOptions , runWithoutRecursiveWatches ?: boolean ) : TestServerHost {
468
+ function sys ( watchOptions : ts . WatchOptions , osFlavor ?: TestServerHostOsFlavor . Linux ) : TestServerHost {
468
469
const configFile : File = {
469
470
path : `/user/username/projects/myproject/tsconfig.json` ,
470
471
content : jsonToReadableText ( { exclude : [ "node_modules" ] , watchOptions } ) ,
@@ -490,7 +491,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
490
491
content : "export function temp(): string;" ,
491
492
} ;
492
493
const files = [ libFile , main , bar , foo , fooBar , temp , configFile ] ;
493
- return createWatchedSystem ( files , { currentDirectory : "/user/username/projects/myproject" , runWithoutRecursiveWatches } ) ;
494
+ return createWatchedSystem ( files , { currentDirectory : "/user/username/projects/myproject" , osFlavor } ) ;
494
495
}
495
496
496
497
function verifyWorker ( ...additionalFlags : string [ ] ) {
@@ -526,7 +527,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
526
527
scenario,
527
528
subScenario : `watchOptions/with excludeDirectories option with recursive directory watching${ additionalFlags . join ( "" ) } ` ,
528
529
commandLineArgs : [ "-w" , ...additionalFlags ] ,
529
- sys : ( ) => sys ( { excludeDirectories : [ "**/temp" ] } , /*runWithoutRecursiveWatches*/ true ) ,
530
+ sys : ( ) => sys ( { excludeDirectories : [ "**/temp" ] } , TestServerHostOsFlavor . Linux ) ,
530
531
edits : [
531
532
{
532
533
caption : "Directory watch updates because of main.js creation" ,
@@ -599,7 +600,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
599
600
} ,
600
601
{
601
602
currentDirectory : "/user/username/projects/myproject" ,
602
- inodeWatching : true ,
603
+ osFlavor : TestServerHostOsFlavor . MacOs ,
603
604
} ,
604
605
) ,
605
606
edits : [
@@ -630,7 +631,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
630
631
} ,
631
632
{
632
633
currentDirectory : "/user/username/projects/myproject" ,
633
- inodeWatching : true ,
634
+ osFlavor : TestServerHostOsFlavor . MacOs ,
634
635
} ,
635
636
) ,
636
637
edits : [
@@ -664,7 +665,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
664
665
} ,
665
666
{
666
667
currentDirectory : "/user/username/projects/myproject" ,
667
- inodeWatching : true ,
668
+ osFlavor : TestServerHostOsFlavor . MacOs ,
668
669
} ,
669
670
) ,
670
671
edits : [
@@ -690,10 +691,10 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
690
691
} ) ;
691
692
692
693
describe ( "with fsWatch with fsWatchWithTimestamp" , ( ) => {
693
- function verify ( fsWatchWithTimestamp : boolean , watchFile ?: "useFsEventsOnParentDirectory" ) {
694
+ function verify ( osFlavor : TestServerHostOsFlavor , watchFile ?: "useFsEventsOnParentDirectory" ) {
694
695
verifyTscWatch ( {
695
696
scenario,
696
- subScenario : `fsWatch/fsWatchWithTimestamp ${ fsWatchWithTimestamp } ${ watchFile ? ` ${ watchFile } ` : "" } ` ,
697
+ subScenario : `fsWatch/fsWatchWithTimestamp ${ osFlavor === TestServerHostOsFlavor . MacOs } ${ watchFile ? ` ${ watchFile } ` : "" } ` ,
697
698
commandLineArgs : [ "-w" , "--extendedDiagnostics" , ...( watchFile ? [ "--watchFile" , watchFile ] : [ ] ) ] ,
698
699
sys : ( ) =>
699
700
createWatchedSystem (
@@ -704,7 +705,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
704
705
} ,
705
706
{
706
707
currentDirectory : "/user/username/projects/myproject" ,
707
- fsWatchWithTimestamp ,
708
+ osFlavor ,
708
709
} ,
709
710
) ,
710
711
edits : [
@@ -721,10 +722,10 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
721
722
] ,
722
723
} ) ;
723
724
}
724
- verify ( /*fsWatchWithTimestamp*/ true ) ;
725
- verify ( /*fsWatchWithTimestamp*/ false ) ;
726
- verify ( /*fsWatchWithTimestamp*/ true , "useFsEventsOnParentDirectory" ) ;
727
- verify ( /*fsWatchWithTimestamp*/ false , "useFsEventsOnParentDirectory" ) ;
725
+ verify ( TestServerHostOsFlavor . MacOs ) ;
726
+ verify ( TestServerHostOsFlavor . Windows ) ;
727
+ verify ( TestServerHostOsFlavor . MacOs , "useFsEventsOnParentDirectory" ) ;
728
+ verify ( TestServerHostOsFlavor . Windows , "useFsEventsOnParentDirectory" ) ;
728
729
} ) ;
729
730
730
731
verifyTscWatch ( {
0 commit comments