Skip to content

Commit 58dfeac

Browse files
TrottMylesBorins
authored andcommitted
test: use mustCall() in pummel test
Replace 'exit' check with common.mustCall(). PR-URL: #34327 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 02ea320 commit 58dfeac

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/pummel/test-net-connect-econnrefused.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,14 @@ function pummel() {
4848
}
4949

5050
function check() {
51-
setTimeout(function() {
51+
setTimeout(common.mustCall(function() {
5252
assert.strictEqual(process._getActiveRequests().length, 0);
5353
const activeHandles = process._getActiveHandles();
5454
assert.ok(activeHandles.every((val) => val.constructor.name !== 'Socket'));
55-
check_called = true;
56-
}, 0);
55+
}), 0);
5756
}
58-
let check_called = false;
5957

6058
process.on('exit', function() {
6159
assert.strictEqual(rounds, ROUNDS);
6260
assert.strictEqual(reqs, ROUNDS * ATTEMPTS_PER_ROUND);
63-
assert(check_called);
6461
});

0 commit comments

Comments
 (0)