@@ -26,7 +26,7 @@ describe('watch mode file watcher', () => {
2626
2727 beforeEach ( ( ) => {
2828 changesCount = 0 ;
29- watcher = new FilesWatcher ( { throttle : 100 } ) ;
29+ watcher = new FilesWatcher ( { debounce : 100 } ) ;
3030 watcher . on ( 'changed' , ( ) => changesCount ++ ) ;
3131 } ) ;
3232
@@ -51,7 +51,7 @@ describe('watch mode file watcher', () => {
5151 assert . strictEqual ( changesCount , 1 ) ;
5252 } ) ;
5353
54- it ( 'should throttle changes' , async ( ) => {
54+ it ( 'should debounce changes' , async ( ) => {
5555 const file = path . join ( tmpdir . path , 'file2' ) ;
5656 writeFileSync ( file , 'written' ) ;
5757 watcher . filterFile ( file ) ;
@@ -61,7 +61,7 @@ describe('watch mode file watcher', () => {
6161 writeFileSync ( file , '2' ) ;
6262 writeFileSync ( file , '3' ) ;
6363 writeFileSync ( file , '4' ) ;
64- await setTimeout ( 200 ) ; // throttle * 2
64+ await setTimeout ( 200 ) ; // debounce * 2
6565 writeFileSync ( file , '5' ) ;
6666 const changed = once ( watcher , 'changed' ) ;
6767 writeFileSync ( file , 'after' ) ;
@@ -86,8 +86,8 @@ describe('watch mode file watcher', () => {
8686 await writeAndWaitForChanges ( watcher , file ) ;
8787
8888 writeFileSync ( file , '1' ) ;
89+ assert . strictEqual ( changesCount , 1 ) ;
8990
90- await setTimeout ( 200 ) ; // avoid throttling
9191 watcher . clearFileFilters ( ) ;
9292 writeFileSync ( file , '2' ) ;
9393 // Wait for this long to make sure changes are triggered only once
@@ -97,7 +97,7 @@ describe('watch mode file watcher', () => {
9797
9898 it ( 'should watch all files in watched path when in "all" mode' ,
9999 { skip : ! supportsRecursiveWatching } , async ( ) => {
100- watcher = new FilesWatcher ( { throttle : 100 , mode : 'all' } ) ;
100+ watcher = new FilesWatcher ( { debounce : 100 , mode : 'all' } ) ;
101101 watcher . on ( 'changed' , ( ) => changesCount ++ ) ;
102102
103103 const file = path . join ( tmpdir . path , 'file5' ) ;
0 commit comments