@@ -133,25 +133,31 @@ async function runTests() {
133133 } else {
134134 console . log ( "Running runtime docstrings tests" ) ;
135135
136- const generated_mocha_test_res = path . join ( "tests" , "docstrings_examples" , "generated_mocha_test.res" )
136+ const generated_mocha_test_res = path . join (
137+ "tests" ,
138+ "docstrings_examples" ,
139+ "generated_mocha_test.res" ,
140+ ) ;
137141
138142 // Remove `generated_mocha_test.res` if file exists
139143 if ( fs . existsSync ( generated_mocha_test_res ) ) {
140- console . log ( `Removing ${ generated_mocha_test_res } ` )
141- fs . unlinkSync ( generated_mocha_test_res )
144+ console . log ( `Removing ${ generated_mocha_test_res } ` ) ;
145+ fs . unlinkSync ( generated_mocha_test_res ) ;
142146 }
143147
144148 cp . execSync ( `${ rescript_exe } build` , {
145149 cwd : path . join ( __dirname , ".." , "tests/docstrings_examples" ) ,
146150 stdio : [ 0 , 1 , 2 ] ,
147151 } ) ;
148152
149-
150153 // Generate rescript file with all tests `generated_mocha_test.res`
151- cp . execSync ( `node ${ path . join ( "tests" , "docstrings_examples" , "DocTest.res.mjs" ) } ` , {
152- cwd : path . join ( __dirname , ".." ) ,
153- stdio : [ 0 , 1 , 2 ] ,
154- } )
154+ cp . execSync (
155+ `node ${ path . join ( "tests" , "docstrings_examples" , "DocTest.res.mjs" ) } ` ,
156+ {
157+ cwd : path . join ( __dirname , ".." ) ,
158+ stdio : [ 0 , 1 , 2 ] ,
159+ } ,
160+ ) ;
155161
156162 // Build again to check if generated_mocha_test.res has syntax or type erros
157163 cp . execSync ( `${ rescript_exe } build` , {
@@ -160,17 +166,20 @@ async function runTests() {
160166 } ) ;
161167
162168 // Format generated_mocha_test.res
163- console . log ( "Formatting generated_mocha_test.res" )
169+ console . log ( "Formatting generated_mocha_test.res" ) ;
164170 cp . execSync ( `./cli/rescript format ${ generated_mocha_test_res } ` , {
165171 cwd : path . join ( __dirname , ".." ) ,
166172 stdio : [ 0 , 1 , 2 ] ,
167- } )
168-
169- console . log ( "Run mocha test" )
170- cp . execSync ( `npx mocha ${ path . join ( "tests" , "docstrings_examples" , "generated_mocha_test.res.mjs" ) } ` , {
171- cwd : path . join ( __dirname , ".." ) ,
172- stdio : [ 0 , 1 , 2 ] ,
173173 } ) ;
174+
175+ console . log ( "Run mocha test" ) ;
176+ cp . execSync (
177+ `npx mocha ${ path . join ( "tests" , "docstrings_examples" , "generated_mocha_test.res.mjs" ) } ` ,
178+ {
179+ cwd : path . join ( __dirname , ".." ) ,
180+ stdio : [ 0 , 1 , 2 ] ,
181+ } ,
182+ ) ;
174183 }
175184 }
176185}
0 commit comments