@@ -774,18 +774,23 @@ const runTests = function(baseopts) {
774
774
await delay ( ) ;
775
775
let watcher = chokidar_watch ( watchPath , options ) ;
776
776
const spy = await aspy ( watcher , 'all' ) ;
777
- setTimeout ( async ( ) => {
778
- await write ( addFile , Date . now ( ) ) ;
779
- await write ( subFile , Date . now ( ) ) ;
780
- await fs_unlink ( aFile ) ;
781
- await fs_unlink ( bFile ) ;
782
- } , 50 ) ;
783
- await waitFor ( [ [ spy . withArgs ( 'add' ) , 3 ] , spy . withArgs ( 'unlink' ) , spy . withArgs ( 'change' ) ] ) ;
784
- spy . withArgs ( 'add' ) . should . have . been . calledThrice ;
785
- spy . should . have . been . calledWith ( 'unlink' , aFile ) ;
777
+ await Promise . all ( [
778
+ write ( addFile , Date . now ( ) ) ,
779
+ write ( subFile , Date . now ( ) ) ,
780
+ fs_unlink ( aFile ) ,
781
+ fs_unlink ( bFile ) ,
782
+ ] ) ;
783
+
784
+ await waitFor ( [ spy . withArgs ( 'change' ) ] ) ;
785
+ spy . withArgs ( 'change' ) . should . have . been . calledOnce ;
786
786
spy . should . have . been . calledWith ( 'change' , subFile ) ;
787
+
788
+ await waitFor ( [ spy . withArgs ( 'unlink' ) ] ) ;
787
789
spy . withArgs ( 'unlink' ) . should . have . been . calledOnce ;
788
- spy . withArgs ( 'change' ) . should . have . been . calledOnce ;
790
+ spy . should . have . been . calledWith ( 'unlink' , aFile ) ;
791
+
792
+ await waitFor ( [ [ spy . withArgs ( 'add' ) , 3 ] ] ) ;
793
+ spy . withArgs ( 'add' ) . should . have . been . calledThrice ;
789
794
} ) ;
790
795
it ( 'should resolve relative paths with glob patterns' , async ( ) => {
791
796
const id = subdirId . toString ( ) ;
@@ -798,10 +803,10 @@ const runTests = function(baseopts) {
798
803
const spy = await aspy ( watcher , 'all' ) ;
799
804
800
805
spy . should . have . been . calledWith ( 'add' ) ;
801
- setTimeout ( async ( ) => {
802
- await write ( addPath , Date . now ( ) ) ;
803
- await write ( changePath , Date . now ( ) ) ;
804
- } , 50 ) ;
806
+ await Promise . all ( [
807
+ write ( addPath , Date . now ( ) ) ,
808
+ write ( changePath , Date . now ( ) )
809
+ ] ) ;
805
810
await waitFor ( [ [ spy , 3 ] , spy . withArgs ( 'add' , addPath ) ] ) ;
806
811
spy . should . have . been . calledWith ( 'add' , addPath ) ;
807
812
spy . should . have . been . calledWith ( 'change' , changePath ) ;
@@ -2010,7 +2015,7 @@ const runTests = function(baseopts) {
2010
2015
} ;
2011
2016
2012
2017
describe ( 'chokidar' , function ( ) {
2013
- this . timeout ( 6000 ) ;
2018
+ this . timeout ( 60000 ) ;
2014
2019
before ( async ( ) => {
2015
2020
let created = 0 ;
2016
2021
await rimraf ( FIXTURES_PATH ) ;
0 commit comments