1+ open RescriptCore
2+
13module Node = {
24 module Path = {
35 @module ("path" ) external join2 : (string , string ) => string = "join"
@@ -41,14 +43,13 @@ module Node = {
4143
4244 type readable
4345 type spawnReturns = {stderr : readable , stdout : readable }
44- type options = {cwd ?: string }
46+ type options = {cwd ?: string , env ?: Dict . t < string >, timeout ?: int }
4547 @module ("child_process" )
4648 external spawn : (string , array <string >, ~options : options = ?) => spawnReturns = "spawn"
4749
4850 @send external on : (readable , string , Buffer .t => unit ) => unit = "on"
4951 @send
50- external once : (spawnReturns , string , (Js .Null .t <float >, Js .Null .t <string >) => unit ) => unit =
51- "once"
52+ external once : (spawnReturns , string , (Null .t <float >, Null .t <string >) => unit ) => unit = "once"
5253 }
5354
5455 module OS = {
@@ -57,7 +58,6 @@ module Node = {
5758 }
5859}
5960
60- open RescriptCore
6161open Node
6262
6363module Docgen = RescriptTools .Docgen
@@ -299,8 +299,11 @@ let getCodeBlocks = example => {
299299let runtimeTests = async code => {
300300 let {stdout , stderr } = await SpawnAsync .run (
301301 ~command = "node" ,
302- ~args = ["-p" , code ],
303- ~options = {cwd : compilerDir },
302+ ~args = ["-e" , code ],
303+ ~options = {
304+ cwd : compilerDir ,
305+ timeout : 2000 ,
306+ },
304307 )
305308
306309 switch Array .length (stderr ) > 0 {
0 commit comments