@@ -34,12 +34,12 @@ if (process.argv.includes("-docstrings")) {
3434 runtimeDocstrings = true ;
3535}
3636
37- // -all dont include runtimeDocstrings
3837if ( process . argv . includes ( "-all" ) ) {
3938 ounitTest = true ;
4039 mochaTest = true ;
4140 bsbTest = true ;
4241 formatTest = true ;
42+ runtimeDocstrings = true ;
4343}
4444
4545async function runTests ( ) {
@@ -128,27 +128,37 @@ async function runTests() {
128128 }
129129
130130 if ( runtimeDocstrings ) {
131- // if (process.platform === "win32") {
132- // console.log(`Skipping docstrings tests on ${process.platform}`);
133- // } else {
134- console . log ( "Running runtime docstrings tests" ) ;
135- cp . execSync ( `${ rescript_exe } build` , {
136- cwd : path . join ( __dirname , ".." , "tests/docstrings_examples" ) ,
137- stdio : [ 0 , 1 , 2 ] ,
138- } ) ;
131+ if ( process . platform === "win32" ) {
132+ console . log ( `Skipping docstrings tests on ${ process . platform } ` ) ;
133+ } else {
134+ console . log ( "Running runtime docstrings tests" ) ;
135+ cp . execSync ( `${ rescript_exe } build` , {
136+ cwd : path . join ( __dirname , ".." , "tests/docstrings_examples" ) ,
137+ stdio : [ 0 , 1 , 2 ] ,
138+ } ) ;
139139
140- console . log ( "Formatting mocha_full_test.res" )
141- cp . execSync ( `${ path . resolve ( "./cli/rescript" ) } format ${ path . join ( "tests" , "docstrings_examples" , "mocha_full_test.res" ) } ` , {
142- cwd : path . join ( __dirname , ".." ) ,
143- stdio : [ 0 , 1 , 2 ] ,
144- } )
140+ cp . execSync ( `node ${ path . join ( "tests" , "docstrings_examples" , "DocTest.res.mjs" ) } ` , {
141+ cwd : path . join ( __dirname , ".." ) ,
142+ stdio : [ 0 , 1 , 2 ] ,
143+ } )
145144
146- console . log ( "Run mocha test" )
147- cp . execSync ( `npx mocha ${ path . join ( "tests" , "docstrings_examples" , "mocha_full_test.res.mjs" ) } ` , {
148- cwd : path . join ( __dirname , ".." ) ,
149- stdio : [ 0 , 1 , 2 ] ,
150- } ) ;
151- // }
145+ cp . execSync ( `${ rescript_exe } build` , {
146+ cwd : path . join ( __dirname , ".." , "tests/docstrings_examples" ) ,
147+ stdio : [ 0 , 1 , 2 ] ,
148+ } ) ;
149+
150+ console . log ( "Formatting generated_mocha_test.res" )
151+ cp . execSync ( `./cli/rescript format ${ path . join ( "tests" , "docstrings_examples" , "generated_mocha_test.res" ) } ` , {
152+ cwd : path . join ( __dirname , ".." ) ,
153+ stdio : [ 0 , 1 , 2 ] ,
154+ } )
155+
156+ console . log ( "Run mocha test" )
157+ cp . execSync ( `npx mocha ${ path . join ( "tests" , "docstrings_examples" , "generated_mocha_test.res.mjs" ) } ` , {
158+ cwd : path . join ( __dirname , ".." ) ,
159+ stdio : [ 0 , 1 , 2 ] ,
160+ } ) ;
161+ }
152162 }
153163}
154164
0 commit comments