From 2582083f63da97cc557dace108737246197edbb3 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 5 Mar 2020 23:12:19 -0800 Subject: [PATCH] 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 PR-URL: https://github.com/nodejs/node/pull/32120 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Robert Nagy --- test/sequential/test-net-reconnect-error.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/sequential/test-net-reconnect-error.js b/test/sequential/test-net-reconnect-error.js index 30c7612c271d47..93d8f3673abda4 100644 --- a/test/sequential/test-net-reconnect-error.js +++ b/test/sequential/test-net-reconnect-error.js @@ -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); -});