File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,10 @@ class FileSystem extends Helper {
8686 if ( sec === 0 ) assert . fail ( 'Use `seeFile` instead of waiting 0 seconds!' )
8787 this . file = path . join ( this . dir , name )
8888 this . debugSection ( 'File' , this . file )
89- for ( const t = Date . now ( ) + sec * 1000 ; ! fileExists ( this . file ) ; ) {
90- if ( t < Date . now ( ) ) throw new Error ( `file (${ name } ) still not present in directory ${ this . dir } after ${ sec } sec` )
91- await new Promise ( resolve => setTimeout ( resolve , 500 ) )
89+ const endTime = Date . now ( ) + sec * 1000
90+ while ( ! fileExists ( this . file ) ) {
91+ if ( endTime < Date . now ( ) ) throw new Error ( `file (${ name } ) still not present in directory ${ this . dir } after ${ sec } sec` )
92+ await new Promise ( resolve => setTimeout ( resolve , 200 ) )
9293 }
9394 }
9495
You can’t perform that action at this time.
0 commit comments