From 3cd3796c5d7a11d40ec074becb597a11806084f6 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Thu, 14 Apr 2022 21:01:06 +0900 Subject: [PATCH] fix: update the tc This removes assertions where the child could be {un}referred. --- test/parallel/test-child-process-hasref.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/test/parallel/test-child-process-hasref.js b/test/parallel/test-child-process-hasref.js index eba640f438756a..fd8541a4c3539f 100644 --- a/test/parallel/test-child-process-hasref.js +++ b/test/parallel/test-child-process-hasref.js @@ -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)), +);