Skip to content

Commit 4b64114

Browse files
committed
use on method
1 parent eb83930 commit 4b64114

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/docstrings_examples/DocTest.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module Node = {
3636
external spawn: (string, array<string>, ~options: options=?) => spawnReturns = "spawn"
3737

3838
@send external on: (readable, string, Buffer.t => unit) => unit = "on"
39+
@send external onFromSpawn: (spawnReturns, string, Js.Null.t<float> => unit) => unit = "on"
3940
@send
4041
external once: (spawnReturns, string, (Js.Null.t<float>, Js.Null.t<string>) => unit) => unit =
4142
"once"
@@ -98,7 +99,7 @@ module SpawnAsync = {
9899
spawn.stderr->ChildProcess.on("data", data => {
99100
Array.push(stderr, data)
100101
})
101-
spawn->ChildProcess.once("close", (code, _signal) => {
102+
spawn->ChildProcess.onFromSpawn("close", (code) => {
102103
resolve({stdout, stderr, code})
103104
})
104105
})

tests/docstrings_examples/DocTest.res.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async function run(command, args, options) {
7272
spawn.stderr.on("data", data => {
7373
stderr.push(data);
7474
});
75-
spawn.once("close", (code, _signal) => resolve({
75+
spawn.on("close", code => resolve({
7676
stdout: stdout,
7777
stderr: stderr,
7878
code: code
@@ -186,7 +186,7 @@ function extractDocFromFile(file) {
186186
RE_EXN_ID: "Assert_failure",
187187
_1: [
188188
"DocTest.res",
189-
198,
189+
199,
190190
9
191191
],
192192
Error: new Error()

0 commit comments

Comments
 (0)