Skip to content

Commit ca38f70

Browse files
kmccmk9Fishrock123
authored andcommitted
test: refactor test-net-keepalive.js
- Replace require() vars with const. - Replace assert.equal() with assert.strictEqual(). - Add common.mustCall() to the setTimeout() callback. PR-URL: #9995 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent ae53a6e commit ca38f70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-net-keepalive.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var net = require('net');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const net = require('net');
55

66
var serverConnection;
77
var clientConnection;
88
var echoServer = net.createServer(function(connection) {
99
serverConnection = connection;
10-
setTimeout(function() {
10+
setTimeout(common.mustCall(function() {
1111
// make sure both connections are still open
12-
assert.equal(serverConnection.readyState, 'open');
13-
assert.equal(clientConnection.readyState, 'open');
12+
assert.strictEqual(serverConnection.readyState, 'open');
13+
assert.strictEqual(clientConnection.readyState, 'open');
1414
serverConnection.end();
1515
clientConnection.end();
1616
echoServer.close();
17-
}, common.platformTimeout(100));
17+
}, 1), common.platformTimeout(100));
1818
connection.setTimeout(0);
1919
assert.notEqual(connection.setKeepAlive, undefined);
2020
// send a keepalive packet after 50 ms

0 commit comments

Comments
 (0)