Skip to content

Commit

Permalink
fix: update the tc
Browse files Browse the repository at this point in the history
This removes assertions where the child could be {un}referred.
  • Loading branch information
daeyeon committed Apr 14, 2022
1 parent 1f500a3 commit 3cd3796
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions test/parallel/test-child-process-hasref.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ assert.strictEqual(child.hasRef(), false);
child.ref();
assert.strictEqual(child.hasRef(), true);

function mustHasRef() {
return common.mustCall(() => assert.strictEqual(child.hasRef(), true));
}

function mustHasNoRef() {
return common.mustCall(() => assert.strictEqual(child.hasRef(), false));
}

child.stdout.on('data', mustHasRef());
child.stdout.on('end', mustHasRef());
child.stdout.on('close', mustHasNoRef());
child.on('exit', mustHasNoRef());
child.on('close', mustHasNoRef());
child.on(
'exit',
common.mustCall(() => assert.strictEqual(child.hasRef(), false)),
);

child.on(
'close',
common.mustCall(() => assert.strictEqual(child.hasRef(), false)),
);

0 comments on commit 3cd3796

Please sign in to comment.