@@ -32,8 +32,7 @@ const testMe = repl.start({
3232testMe . _domain . on ( 'error' , assert . ifError ) ;
3333
3434// Tab complete provides built in libs for import()
35- testMe . complete ( 'import(\'' , common . mustCall ( ( error , data ) => {
36- assert . strictEqual ( error , null ) ;
35+ testMe . complete ( 'import(\'' , common . mustSucceed ( ( data ) => {
3736 publicUnprefixedModules . forEach ( ( lib ) => {
3837 assert (
3938 data [ 0 ] . includes ( lib ) && data [ 0 ] . includes ( `node:${ lib } ` ) ,
@@ -43,15 +42,14 @@ testMe.complete('import(\'', common.mustCall((error, data) => {
4342 const newModule = 'foobar' ;
4443 assert ( ! builtinModules . includes ( newModule ) ) ;
4544 repl . builtinModules . push ( newModule ) ;
46- testMe . complete ( 'import(\'' , common . mustCall ( ( _ , [ modules ] ) => {
45+ testMe . complete ( 'import(\'' , common . mustSucceed ( ( [ modules ] ) => {
4746 assert . strictEqual ( data [ 0 ] . length + 1 , modules . length ) ;
4847 assert ( modules . includes ( newModule ) &&
4948 ! modules . includes ( `node:${ newModule } ` ) ) ;
5049 } ) ) ;
5150} ) ) ;
5251
53- testMe . complete ( "import\t( 'n" , common . mustCall ( ( error , data ) => {
54- assert . strictEqual ( error , null ) ;
52+ testMe . complete ( "import\t( 'n" , common . mustSucceed ( ( data ) => {
5553 assert . strictEqual ( data . length , 2 ) ;
5654 assert . strictEqual ( data [ 1 ] , 'n' ) ;
5755 const completions = data [ 0 ] ;
@@ -77,16 +75,14 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) => {
7775 // Import calls should handle all types of quotation marks.
7876 for ( const quotationMark of [ "'" , '"' , '`' ] ) {
7977 putIn . run ( [ '.clear' ] ) ;
80- testMe . complete ( 'import(`@nodejs' , common . mustCall ( ( err , data ) => {
81- assert . strictEqual ( err , null ) ;
78+ testMe . complete ( 'import(`@nodejs' , common . mustSucceed ( ( data ) => {
8279 assert . deepStrictEqual ( data , [ expected , '@nodejs' ] ) ;
8380 } ) ) ;
8481
8582 putIn . run ( [ '.clear' ] ) ;
8683 // Completions should not be greedy in case the quotation ends.
8784 const input = `import(${ quotationMark } @nodejsscope${ quotationMark } ` ;
88- testMe . complete ( input , common . mustCall ( ( err , data ) => {
89- assert . strictEqual ( err , null ) ;
85+ testMe . complete ( input , common . mustSucceed ( ( data ) => {
9086 assert . deepStrictEqual ( data , [ [ ] , undefined ] ) ;
9187 } ) ) ;
9288 }
@@ -96,8 +92,7 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) => {
9692 putIn . run ( [ '.clear' ] ) ;
9793 // Completions should find modules and handle whitespace after the opening
9894 // bracket.
99- testMe . complete ( 'import \t("no_ind' , common . mustCall ( ( err , data ) => {
100- assert . strictEqual ( err , null ) ;
95+ testMe . complete ( 'import \t("no_ind' , common . mustSucceed ( ( data ) => {
10196 assert . deepStrictEqual ( data , [ [ 'no_index' , 'no_index/' ] , 'no_ind' ] ) ;
10297 } ) ) ;
10398}
@@ -110,8 +105,7 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) => {
110105 process . chdir ( __dirname ) ;
111106
112107 [ 'import(\'.' , 'import(".' ] . forEach ( ( input ) => {
113- testMe . complete ( input , common . mustCall ( ( err , data ) => {
114- assert . strictEqual ( err , null ) ;
108+ testMe . complete ( input , common . mustSucceed ( ( data ) => {
115109 assert . strictEqual ( data . length , 2 ) ;
116110 assert . strictEqual ( data [ 1 ] , '.' ) ;
117111 assert . strictEqual ( data [ 0 ] . length , 2 ) ;
@@ -121,16 +115,14 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) => {
121115 } ) ;
122116
123117 [ 'import(\'..' , 'import("..' ] . forEach ( ( input ) => {
124- testMe . complete ( input , common . mustCall ( ( err , data ) => {
125- assert . strictEqual ( err , null ) ;
118+ testMe . complete ( input , common . mustSucceed ( ( data ) => {
126119 assert . deepStrictEqual ( data , [ [ '../' ] , '..' ] ) ;
127120 } ) ) ;
128121 } ) ;
129122
130123 [ './' , './test-' ] . forEach ( ( path ) => {
131124 [ `import('${ path } ` , `import("${ path } ` ] . forEach ( ( input ) => {
132- testMe . complete ( input , common . mustCall ( ( err , data ) => {
133- assert . strictEqual ( err , null ) ;
125+ testMe . complete ( input , common . mustSucceed ( ( data ) => {
134126 assert . strictEqual ( data . length , 2 ) ;
135127 assert . strictEqual ( data [ 1 ] , path ) ;
136128 assert . ok ( data [ 0 ] . includes ( './test-repl-tab-complete.js' ) ) ;
@@ -140,8 +132,7 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) => {
140132
141133 [ '../parallel/' , '../parallel/test-' ] . forEach ( ( path ) => {
142134 [ `import('${ path } ` , `import("${ path } ` ] . forEach ( ( input ) => {
143- testMe . complete ( input , common . mustCall ( ( err , data ) => {
144- assert . strictEqual ( err , null ) ;
135+ testMe . complete ( input , common . mustSucceed ( ( data ) => {
145136 assert . strictEqual ( data . length , 2 ) ;
146137 assert . strictEqual ( data [ 1 ] , path ) ;
147138 assert . ok ( data [ 0 ] . includes ( '../parallel/test-repl-tab-complete.js' ) ) ;
0 commit comments