File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,22 +380,22 @@ for (const type of apiTypes) {
380380 } ) ;
381381}
382382
383- test ( `[async] crawl directory & use abort signal to abort` , async ( t ) => {
384- // AbortController is not present on Node v14
385- if ( ! ( "AbortController" in globalThis ) ) return ;
386-
387- const totalFiles = new fdir ( ) . onlyCounts ( ) . crawl ( "node_modules" ) . sync ( ) ;
388- const abortController = new AbortController ( ) ;
389- const api = new fdir ( )
390- . withAbortSignal ( abortController . signal )
391- . filter ( ( p ) => {
392- if ( p . endsWith ( ".js" ) ) abortController . abort ( ) ;
393- return true ;
394- } )
395- . crawl ( "node_modules" ) ;
396- const files = await api . withPromise ( ) ;
397- t . expect ( files . length ) . toBeLessThan ( totalFiles . files ) ;
398- } ) ;
383+ // AbortController is not present on Node v14
384+ if ( " AbortController" in globalThis ) {
385+ test ( `[async] crawl directory & use abort signal to abort` , async ( t ) => {
386+ const totalFiles = new fdir ( ) . onlyCounts ( ) . crawl ( "node_modules" ) . sync ( ) ;
387+ const abortController = new AbortController ( ) ;
388+ const api = new fdir ( )
389+ . withAbortSignal ( abortController . signal )
390+ . filter ( ( p ) => {
391+ if ( p . endsWith ( ".js" ) ) abortController . abort ( ) ;
392+ return true ;
393+ } )
394+ . crawl ( "node_modules" ) ;
395+ const files = await api . withPromise ( ) ;
396+ t . expect ( files . length ) . toBeLessThan ( totalFiles . files ) ;
397+ } ) ;
398+ }
399399
400400test ( `paths should never start with ./` , async ( t ) => {
401401 const apis = [
You can’t perform that action at this time.
0 commit comments