@@ -567,7 +567,7 @@ namespace ts.projectSystem {
567
567
} ) ;
568
568
569
569
describe ( "excludeDirectories" , ( ) => {
570
- function setup ( _configureHost ?: boolean ) {
570
+ function setup ( configureHost ?: boolean ) {
571
571
const configFile : File = {
572
572
path : `${ tscWatch . projectRoot } /tsconfig.json` ,
573
573
content : JSON . stringify ( { include : [ "src" ] , watchOptions : { excludeDirectories : [ "node_modules" ] } } )
@@ -587,6 +587,11 @@ namespace ts.projectSystem {
587
587
const files = [ libFile , main , bar , foo , configFile ] ;
588
588
const host = createServerHost ( files , { currentDirectory : tscWatch . projectRoot } ) ;
589
589
const service = createProjectService ( host ) ;
590
+ if ( configureHost ) {
591
+ service . setHostConfiguration ( {
592
+ watchOptions : { excludeDirectories : [ "node_modules" ] }
593
+ } ) ;
594
+ }
590
595
service . openClientFile ( main . path ) ;
591
596
return { host, configFile } ;
592
597
}
@@ -611,11 +616,8 @@ namespace ts.projectSystem {
611
616
checkWatchedDirectories ( host , emptyArray , /*recursive*/ false ) ;
612
617
checkWatchedDirectoriesDetailed (
613
618
host ,
614
- arrayToMap (
615
- [ `${ tscWatch . projectRoot } /src` , `${ tscWatch . projectRoot } /node_modules` ] ,
616
- identity ,
617
- f => f === `${ tscWatch . projectRoot } /node_modules` ? 1 : 2 ,
618
- ) ,
619
+ [ `${ tscWatch . projectRoot } /src` ] ,
620
+ 2 ,
619
621
/*recursive*/ true ,
620
622
) ;
621
623
} ) ;
0 commit comments