File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -531,15 +531,16 @@ export class NodeFsHandler {
531531 directory : string ,
532532 initialAdd : boolean ,
533533 wh : WatchHelper ,
534- target : Path ,
534+ target : Path | undefined ,
535535 dir : Path ,
536536 depth : number ,
537537 throttler : Throttler
538538 ) : Promise < unknown > | undefined {
539539 // Normalize the directory name on Windows
540540 directory = sp . join ( directory , '' ) ;
541541
542- throttler = this . fsw . _throttle ( 'readdir' , directory , 1000 ) as Throttler ;
542+ const throttleKey = target ? `${ directory } :${ target } ` : directory ;
543+ throttler = this . fsw . _throttle ( 'readdir' , throttleKey , 1000 ) as Throttler ;
543544 if ( ! throttler ) return ;
544545
545546 const previous = this . fsw . _getWatchedDir ( wh . path ) ;
@@ -632,7 +633,7 @@ export class NodeFsHandler {
632633 stats : Stats ,
633634 initialAdd : boolean ,
634635 depth : number ,
635- target : string ,
636+ target : string | undefined ,
636637 wh : WatchHelper ,
637638 realpath : string
638639 ) : Promise < ( ( ) => void ) | undefined > {
@@ -713,7 +714,7 @@ export class NodeFsHandler {
713714 stats ,
714715 initialAdd ,
715716 depth ,
716- target ! ,
717+ target ,
717718 wh ,
718719 targetPath
719720 ) ;
Original file line number Diff line number Diff line change @@ -195,7 +195,6 @@ function waitForEvents(watcher: chokidar.FSWatcher, count: number) {
195195
196196const runTests = ( baseopts : chokidar . ChokidarOptions ) => {
197197 let macosFswatch = isMacos && ! baseopts . usePolling ;
198- let win32Polling = isWindows && baseopts . usePolling ;
199198 let options : chokidar . ChokidarOptions ;
200199 USE_SLOW_DELAY = macosFswatch ? 100 : undefined ;
201200 baseopts . persistent = true ;
@@ -568,13 +567,13 @@ const runTests = (baseopts: chokidar.ChokidarOptions) => {
568567 watcher . on ( EV . UNLINK_DIR , unlinkSpy ) . on ( EV . ADD_DIR , addSpy ) ;
569568 await mkdir ( parentPath ) ;
570569
571- await delay ( win32Polling ? 900 : 300 ) ;
570+ await waitFor ( [ [ addSpy , 1 , [ parentPath ] ] ] ) ;
572571 await rmr ( parentPath ) ;
573572 await waitFor ( [ [ unlinkSpy , 1 , [ parentPath ] ] ] ) ;
574573 ok ( calledWith ( unlinkSpy , [ parentPath ] ) ) ;
575574 await mkdir ( parentPath ) ;
576575
577- await delay ( win32Polling ? 2200 : 1200 ) ;
576+ await waitFor ( [ [ addSpy , 2 ] ] ) ;
578577 await mkdir ( subPath ) ;
579578 await waitFor ( [ [ addSpy , 3 ] ] ) ;
580579 ok ( calledWith ( addSpy , [ parentPath ] ) ) ;
You can’t perform that action at this time.
0 commit comments