@@ -285,19 +285,20 @@ describe('copyfiles', () => {
285285 } ) . toThrow ( 'nothing copied' ) ;
286286 } ) ;
287287
288- test ( 'sets followSymbolicLinks when options.follow is true' , ( done : any ) => {
289- if ( process . platform === 'win32' ) return done ( ) ;
288+ test ( 'sets followSymbolicLinks when options.follow is true' , async ( ) => {
289+ if ( process . platform === 'win32' ) return ;
290290 mkdirSync ( 'input/real' , { recursive : true } ) ;
291291 writeFileSync ( 'input/real/a.txt' , 'test' ) ;
292292 symlinkSync ( 'real' , 'input/link' ) ;
293- // Check if symlink was created as a directory symlink
294- if ( ! lstatSync ( 'input/link' ) . isSymbolicLink ( ) ) return done ( ) ;
295- copyfiles ( [ 'input/link/*.txt' , 'output' ] , { follow : true } , ( err ) => {
296- const files = globSync ( 'output/**/*' , { dot : true } ) ;
297- console . log ( 'output contents:' , files ) ;
298- const found = files . some ( f => f . endsWith ( 'a.txt' ) ) ;
299- expect ( found ) . toBe ( true ) ;
300- done ( ) ;
293+ await new Promise < void > ( ( resolve , reject ) => {
294+ copyfiles ( [ 'input/link/*.txt' , 'output' ] , { follow : true } , ( err ) => {
295+ const files = globSync ( 'output/**/*' , { dot : true } ) ;
296+ console . log ( 'output contents:' , files ) ;
297+ const found = files . some ( f => f . endsWith ( 'a.txt' ) ) ;
298+ expect ( found ) . toBe ( true ) ;
299+ if ( err ) reject ( err ) ;
300+ else resolve ( ) ;
301+ } ) ;
301302 } ) ;
302303 } ) ;
303304
0 commit comments