Skip to content

Commit 9a5f852

Browse files
committed
fix: update the tc
This removes the assertion where the child process might be referred.
1 parent 1f500a3 commit 9a5f852

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

test/parallel/test-child-process-hasref.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ assert.strictEqual(child.hasRef(), false);
1515
child.ref();
1616
assert.strictEqual(child.hasRef(), true);
1717

18-
function mustHasRef() {
19-
return common.mustCall(() => assert.strictEqual(child.hasRef(), true));
20-
}
21-
22-
function mustHasNoRef() {
23-
return common.mustCall(() => assert.strictEqual(child.hasRef(), false));
24-
}
25-
26-
child.stdout.on('data', mustHasRef());
27-
child.stdout.on('end', mustHasRef());
28-
child.stdout.on('close', mustHasNoRef());
29-
child.on('exit', mustHasNoRef());
30-
child.on('close', mustHasNoRef());
18+
child.stdout.on(
19+
'data',
20+
common.mustCall(() => assert.strictEqual(child.hasRef(), true)),
21+
);
22+
23+
child.on(
24+
'exit',
25+
common.mustCall(() => assert.strictEqual(child.hasRef(), false)),
26+
);
27+
28+
child.on(
29+
'close',
30+
common.mustCall(() => assert.strictEqual(child.hasRef(), false)),
31+
);

0 commit comments

Comments
 (0)