@@ -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 ) => {
3736publicUnprefixedModules . forEach ( ( lib ) => {
3837assert (
3938data [ 0 ] . includes ( lib ) && data [ 0 ] . includes ( `node:${ lib } ` ) ,
@@ -43,15 +42,14 @@ testMe.complete('import(\'', common.mustCall((error, data) =>{
4342const newModule = 'foobar' ;
4443assert ( ! builtinModules . includes ( newModule ) ) ;
4544repl . builtinModules . push ( newModule ) ;
46- testMe . complete ( 'import(\'' , common . mustCall ( ( _ , [ modules ] ) => {
45+ testMe . complete ( 'import(\'' , common . mustSucceed ( ( [ modules ] ) => {
4746assert . strictEqual ( data [ 0 ] . length + 1 , modules . length ) ;
4847assert ( 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 ) => {
5553assert . strictEqual ( data . length , 2 ) ;
5654assert . strictEqual ( data [ 1 ] , 'n' ) ;
5755const 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.
7876for ( const quotationMark of [ "'" , '"' , '`' ] ) {
7977putIn . run ( [ '.clear' ] ) ;
80- testMe . complete ( 'import(`@nodejs' , common . mustCall ( ( err , data ) => {
81- assert . strictEqual ( err , null ) ;
78+ testMe . complete ( 'import(`@nodejs' , common . mustSucceed ( ( data ) => {
8279assert . deepStrictEqual ( data , [ expected , '@nodejs' ] ) ;
8380} ) ) ;
8481
8582putIn . run ( [ '.clear' ] ) ;
8683// Completions should not be greedy in case the quotation ends.
8784const 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 ) => {
9086assert . deepStrictEqual ( data , [ [ ] , undefined ] ) ;
9187} ) ) ;
9288}
@@ -96,8 +92,7 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) =>{
9692putIn . 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 ) => {
10196assert . deepStrictEqual ( data , [ [ 'no_index' , 'no_index/' ] , 'no_ind' ] ) ;
10297} ) ) ;
10398}
@@ -110,8 +105,7 @@ testMe.complete("import\t( 'n", common.mustCall((error, data) =>{
110105process . 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 ) => {
115109assert . strictEqual ( data . length , 2 ) ;
116110assert . strictEqual ( data [ 1 ] , '.' ) ;
117111assert . 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 ) => {
126119assert . 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 ) => {
134126assert . strictEqual ( data . length , 2 ) ;
135127assert . strictEqual ( data [ 1 ] , path ) ;
136128assert . 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 ) => {
145136assert . strictEqual ( data . length , 2 ) ;
146137assert . strictEqual ( data [ 1 ] , path ) ;
147138assert . ok ( data [ 0 ] . includes ( '../parallel/test-repl-tab-complete.js' ) ) ;
0 commit comments