Skip to content

Commit da7349d

Browse files
TrottMylesBorins
authored andcommitted
test: remove superfluous checks in test-net-reconnect-error
The process.on('exit', ...) checks duplicate the work of `common.mustCall()` and are superfluous. Remove them. Signed-off-by: Rich Trott <[email protected]> PR-URL: #32120 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
1 parent 74edcc5 commit da7349d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

test/sequential/test-net-reconnect-error.js

-7
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,17 @@ const common = require('../common');
2424
const net = require('net');
2525
const assert = require('assert');
2626
const N = 20;
27-
let clientErrorCount = 0;
2827
let disconnectCount = 0;
2928

3029
const c = net.createConnection(common.PORT);
3130

3231
c.on('connect', common.mustNotCall('client should not have connected'));
3332

3433
c.on('error', common.mustCall((e) => {
35-
clientErrorCount++;
3634
assert.strictEqual(e.code, 'ECONNREFUSED');
3735
}, N + 1));
3836

3937
c.on('close', common.mustCall(() => {
4038
if (disconnectCount++ < N)
4139
c.connect(common.PORT); // reconnect
4240
}, N + 1));
43-
44-
process.on('exit', function() {
45-
assert.strictEqual(disconnectCount, N + 1);
46-
assert.strictEqual(clientErrorCount, N + 1);
47-
});

0 commit comments

Comments
 (0)