@@ -2,18 +2,18 @@ import path from 'node:path';
22import process from 'node:process' ;
33import Benchmark from 'benchmark' ;
44import makeDir from 'make-dir' ;
5- import tempy from 'tempy' ;
5+ import { temporaryDirectory } from 'tempy' ;
66import { deleteAsync , deleteSync } from './index.js' ;
77
88const suite = new Benchmark . Suite ( 'concurrency' ) ;
99
10- const temporaryDir = tempy . directory ( ) ;
10+ const temporaryDirectoryPath = temporaryDirectory ( ) ;
1111
12- const fixtures = Array . from ( { length : 2000 } , ( _ , index ) => path . resolve ( temporaryDir , ( index + 1 ) . toString ( ) ) ) ;
12+ const fixtures = Array . from ( { length : 2000 } , ( _ , index ) => path . resolve ( temporaryDirectoryPath , ( index + 1 ) . toString ( ) ) ) ;
1313
1414function createFixtures ( ) {
1515 for ( const fixture of fixtures ) {
16- makeDir . sync ( path . resolve ( temporaryDir , fixture ) ) ;
16+ makeDir . sync ( path . resolve ( temporaryDirectoryPath , fixture ) ) ;
1717 }
1818}
1919
@@ -47,7 +47,7 @@ for (const concurrency of concurrencies) {
4747 createFixtures ( ) ;
4848
4949 const removedFiles = await deleteAsync ( [ '**/*' ] , {
50- cwd : temporaryDir ,
50+ cwd : temporaryDirectoryPath ,
5151 concurrency,
5252 } ) ;
5353
@@ -58,7 +58,7 @@ for (const concurrency of concurrencies) {
5858
5959 console . error ( error ) ;
6060
61- deleteSync ( temporaryDir , { cwd : temporaryDir , force : true } ) ;
61+ deleteSync ( temporaryDirectoryPath , { cwd : temporaryDirectoryPath , force : true } ) ;
6262
6363 // eslint-disable-next-line unicorn/no-process-exit
6464 process . exit ( 1 ) ;
7676 . on ( 'complete' , function ( ) {
7777 console . log ( `Fastest is ${ this . filter ( 'fastest' ) . map ( 'name' ) } ` ) ;
7878
79- deleteSync ( temporaryDir , { cwd : temporaryDir , force : true } ) ;
79+ deleteSync ( temporaryDirectoryPath , { cwd : temporaryDirectoryPath , force : true } ) ;
8080 } )
8181 . run ( { async : true } ) ;
0 commit comments