mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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 <rtrott@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/32120
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
This commit is contained in:
1 parent
f820ce6e50
commit
2582083f63
1 file changed
-7
@@ -24,7 +24,6 @@ const common = require('../common');
|
||||
const net = require('net');
|
||||
const assert = require('assert');
|
||||
const N = 20;
|
||||
let clientErrorCount = 0;
|
||||
let disconnectCount = 0;
|
||||
|
||||
const c = net.createConnection(common.PORT);
|
||||
@@ -32,7 +31,6 @@ const c = net.createConnection(common.PORT);
|
||||
c.on('connect', common.mustNotCall('client should not have connected'));
|
||||
|
||||
c.on('error', common.mustCall((e) => {
|
||||
clientErrorCount++;
|
||||
assert.strictEqual(e.code, 'ECONNREFUSED');
|
||||
}, N + 1));
|
||||
|
||||
@@ -40,8 +38,3 @@ c.on('close', common.mustCall(() => {
|
||||
if (disconnectCount++ < N)
|
||||
c.connect(common.PORT); // reconnect
|
||||
}, N + 1));
|
||||
|
||||
process.on('exit', function() {
|
||||
assert.strictEqual(disconnectCount, N + 1);
|
||||
assert.strictEqual(clientErrorCount, N + 1);
|
||||
});
|
||||
Reference in new issue
Block a user