diff options
Diffstat (limited to 'test/parallel/test-http-agent-keepalive.js')
-rw-r--r-- | test/parallel/test-http-agent-keepalive.js | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js index a78f97edec..9ea3fd7677 100644 --- a/test/parallel/test-http-agent-keepalive.js +++ b/test/parallel/test-http-agent-keepalive.js @@ -37,22 +37,22 @@ function get(path, callback) { } function checkDataAndSockets(body) { - assert.equal(body.toString(), 'hello world'); - assert.equal(agent.sockets[name].length, 1); - assert.equal(agent.freeSockets[name], undefined); + assert.strictEqual(body.toString(), 'hello world'); + assert.strictEqual(agent.sockets[name].length, 1); + assert.strictEqual(agent.freeSockets[name], undefined); } function second() { // request second, use the same socket get('/second', function(res) { - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); res.on('end', function() { - assert.equal(agent.sockets[name].length, 1); - assert.equal(agent.freeSockets[name], undefined); + assert.strictEqual(agent.sockets[name].length, 1); + assert.strictEqual(agent.freeSockets[name], undefined); process.nextTick(function() { - assert.equal(agent.sockets[name], undefined); - assert.equal(agent.freeSockets[name].length, 1); + assert.strictEqual(agent.sockets[name], undefined); + assert.strictEqual(agent.freeSockets[name].length, 1); remoteClose(); }); }); @@ -65,16 +65,16 @@ function remoteClose() { assert.deepStrictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); res.on('end', function() { - assert.equal(agent.sockets[name].length, 1); - assert.equal(agent.freeSockets[name], undefined); + assert.strictEqual(agent.sockets[name].length, 1); + assert.strictEqual(agent.freeSockets[name], undefined); process.nextTick(function() { - assert.equal(agent.sockets[name], undefined); - assert.equal(agent.freeSockets[name].length, 1); + assert.strictEqual(agent.sockets[name], undefined); + assert.strictEqual(agent.freeSockets[name].length, 1); // waitting remote server close the socket setTimeout(function() { - assert.equal(agent.sockets[name], undefined); - assert.equal(agent.freeSockets[name], undefined, - 'freeSockets is not empty'); + assert.strictEqual(agent.sockets[name], undefined); + assert.strictEqual(agent.freeSockets[name], undefined, + 'freeSockets is not empty'); remoteError(); }, common.platformTimeout(200)); }); @@ -89,13 +89,13 @@ function remoteError() { }); req.on('error', function(err) { assert.ok(err); - assert.equal(err.message, 'socket hang up'); - assert.equal(agent.sockets[name].length, 1); - assert.equal(agent.freeSockets[name], undefined); + assert.strictEqual(err.message, 'socket hang up'); + assert.strictEqual(agent.sockets[name].length, 1); + assert.strictEqual(agent.freeSockets[name], undefined); // Wait socket 'close' event emit setTimeout(function() { - assert.equal(agent.sockets[name], undefined); - assert.equal(agent.freeSockets[name], undefined); + assert.strictEqual(agent.sockets[name], undefined); + assert.strictEqual(agent.freeSockets[name], undefined); done(); }, common.platformTimeout(1)); }); @@ -110,14 +110,14 @@ server.listen(0, function() { name = `localhost:${server.address().port}:`; // request first, and keep alive get('/first', function(res) { - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); res.on('end', function() { - assert.equal(agent.sockets[name].length, 1); - assert.equal(agent.freeSockets[name], undefined); + assert.strictEqual(agent.sockets[name].length, 1); + assert.strictEqual(agent.freeSockets[name], undefined); process.nextTick(function() { - assert.equal(agent.sockets[name], undefined); - assert.equal(agent.freeSockets[name].length, 1); + assert.strictEqual(agent.sockets[name], undefined); + assert.strictEqual(agent.freeSockets[name].length, 1); second(); }); }); |