Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add mustCall to setTimeout
Added mustCall to the setTimout inline function. Changed assert.equal
to assert.strictEqual. Changed var for require modules to let.
  • Loading branch information
kmccmk9 committed Dec 1, 2016
commit 0c55efdd3b0bd418bce11a1637629b502e6f6d0e
14 changes: 7 additions & 7 deletions test/parallel/test-net-keepalive.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');
let common = require('../common');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not const instead of let?

let assert = require('assert');
let net = require('net');

var serverConnection;
var clientConnection;
var echoServer = net.createServer(function(connection) {
serverConnection = connection;
setTimeout(function() {
setTimeout(common.mustCall(function() {
// make sure both connections are still open
assert.equal(serverConnection.readyState, 'open');
assert.equal(clientConnection.readyState, 'open');
assert.strictEqual(serverConnection.readyState, 'open');
assert.strictEqual(clientConnection.readyState, 'open');
serverConnection.end();
clientConnection.end();
echoServer.close();
}, common.platformTimeout(100));
},1), common.platformTimeout(100));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a space before the 1 here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: A space before 1

connection.setTimeout(0);
assert.notEqual(connection.setKeepAlive, undefined);
// send a keepalive packet after 50 ms
Expand Down