@@ -402,37 +402,39 @@ testMe.complete('obj.', common.mustCall((error, data) => {
402
402
putIn . run ( [ '.clear' ] ) ;
403
403
process . chdir ( __dirname ) ;
404
404
405
- const readFileSync = 'fs.readFileSync("' ;
406
- const fixturePath = `${ readFileSync } ../fixtures/test-repl-tab-completion` ;
405
+ const readFileSyncs = [ 'fs.readFileSync("' , 'fs.promises.readFileSync("' ] ;
407
406
if ( ! common . isWindows ) {
408
- testMe . complete ( fixturePath , common . mustCall ( ( err , data ) => {
409
- assert . strictEqual ( err , null ) ;
410
- assert . ok ( data [ 0 ] [ 0 ] . includes ( '.hiddenfiles' ) ) ;
411
- assert . ok ( data [ 0 ] [ 1 ] . includes ( 'hellorandom.txt' ) ) ;
412
- assert . ok ( data [ 0 ] [ 2 ] . includes ( 'helloworld.js' ) ) ;
413
- } ) ) ;
407
+ readFileSyncs . forEach ( ( readFileSync ) => {
408
+ const fixturePath = `${ readFileSync } ../fixtures/test-repl-tab-completion` ;
409
+ testMe . complete ( fixturePath , common . mustCall ( ( err , data ) => {
410
+ assert . strictEqual ( err , null ) ;
411
+ assert . ok ( data [ 0 ] [ 0 ] . includes ( '.hiddenfiles' ) ) ;
412
+ assert . ok ( data [ 0 ] [ 1 ] . includes ( 'hellorandom.txt' ) ) ;
413
+ assert . ok ( data [ 0 ] [ 2 ] . includes ( 'helloworld.js' ) ) ;
414
+ } ) ) ;
414
415
415
- testMe . complete ( `${ fixturePath } /hello` ,
416
- common . mustCall ( ( err , data ) => {
417
- assert . strictEqual ( err , null ) ;
418
- assert . ok ( data [ 0 ] [ 0 ] . includes ( 'hellorandom.txt' ) ) ;
419
- assert . ok ( data [ 0 ] [ 1 ] . includes ( 'helloworld.js' ) ) ;
420
- } )
421
- ) ;
422
-
423
- testMe . complete ( `${ fixturePath } /.h` ,
424
- common . mustCall ( ( err , data ) => {
425
- assert . strictEqual ( err , null ) ;
426
- assert . ok ( data [ 0 ] [ 0 ] . includes ( '.hiddenfiles' ) ) ;
427
- } )
428
- ) ;
429
-
430
- testMe . complete ( `${ readFileSync } ./xxxRandom/random` ,
431
- common . mustCall ( ( err , data ) => {
432
- assert . strictEqual ( err , null ) ;
433
- assert . strictEqual ( data [ 0 ] . length , 0 ) ;
434
- } )
435
- ) ;
416
+ testMe . complete ( `${ fixturePath } /hello` ,
417
+ common . mustCall ( ( err , data ) => {
418
+ assert . strictEqual ( err , null ) ;
419
+ assert . ok ( data [ 0 ] [ 0 ] . includes ( 'hellorandom.txt' ) ) ;
420
+ assert . ok ( data [ 0 ] [ 1 ] . includes ( 'helloworld.js' ) ) ;
421
+ } )
422
+ ) ;
423
+
424
+ testMe . complete ( `${ fixturePath } /.h` ,
425
+ common . mustCall ( ( err , data ) => {
426
+ assert . strictEqual ( err , null ) ;
427
+ assert . ok ( data [ 0 ] [ 0 ] . includes ( '.hiddenfiles' ) ) ;
428
+ } )
429
+ ) ;
430
+
431
+ testMe . complete ( `${ readFileSync } ./xxxRandom/random` ,
432
+ common . mustCall ( ( err , data ) => {
433
+ assert . strictEqual ( err , null ) ;
434
+ assert . strictEqual ( data [ 0 ] . length , 0 ) ;
435
+ } )
436
+ ) ;
437
+ } ) ;
436
438
}
437
439
}
438
440
0 commit comments