diff --git a/test/parallel/test-http-server-multiheaders.js b/test/parallel/test-http-server-multiheaders.js index bf918ad24cc168..8f633fdb998970 100644 --- a/test/parallel/test-http-server-multiheaders.js +++ b/test/parallel/test-http-server-multiheaders.js @@ -28,7 +28,7 @@ require('../common'); const assert = require('assert'); const http = require('http'); -const srv = http.createServer(function(req, res) { +const server = http.createServer(function(req, res) { assert.strictEqual(req.headers.accept, 'abc, def, ghijklmnopqrst'); assert.strictEqual(req.headers.host, 'foo'); assert.strictEqual(req.headers['www-authenticate'], 'foo, bar, baz'); @@ -43,10 +43,10 @@ const srv = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('EOF'); - srv.close(); + server.close(); }); -srv.listen(0, function() { +server.listen(0, function() { http.get({ host: 'localhost', port: this.address().port, diff --git a/test/parallel/test-http-server-multiheaders2.js b/test/parallel/test-http-server-multiheaders2.js index 95ee5b61fa916d..1e19708557ef24 100644 --- a/test/parallel/test-http-server-multiheaders2.js +++ b/test/parallel/test-http-server-multiheaders2.js @@ -69,7 +69,7 @@ const multipleForbidden = [ // 'Content-Length', ]; -const srv = http.createServer(function(req, res) { +const server = http.createServer(function(req, res) { multipleForbidden.forEach(function(header) { assert.strictEqual(req.headers[header.toLowerCase()], 'foo', `header parsed incorrectly: ${header}`); @@ -83,7 +83,7 @@ const srv = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('EOF'); - srv.close(); + server.close(); }); function makeHeader(value) { @@ -98,7 +98,7 @@ const headers = [] .concat(multipleAllowed.map(makeHeader('bar'))) .concat(multipleForbidden.map(makeHeader('bar'))); -srv.listen(0, function() { +server.listen(0, function() { http.get({ host: 'localhost', port: this.address().port, diff --git a/test/parallel/test-http-upgrade-agent.js b/test/parallel/test-http-upgrade-agent.js index 5c840eeb532814..cb33edc32e0139 100644 --- a/test/parallel/test-http-upgrade-agent.js +++ b/test/parallel/test-http-upgrade-agent.js @@ -31,7 +31,7 @@ const http = require('http'); const net = require('net'); // Create a TCP server -const srv = net.createServer(function(c) { +const server = net.createServer(function(c) { c.on('data', function(d) { c.write('HTTP/1.1 101\r\n'); c.write('hello: world\r\n'); @@ -46,7 +46,7 @@ const srv = net.createServer(function(c) { }); }); -srv.listen(0, '127.0.0.1', common.mustCall(function() { +server.listen(0, '127.0.0.1', common.mustCall(function() { const options = { port: this.address().port, @@ -82,7 +82,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { req.on('close', common.mustCall(function() { socket.end(); - srv.close(); + server.close(); })); })); })); diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index d18ac273d6dab1..8fe756f469f09a 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -34,7 +34,7 @@ const Countdown = require('../common/countdown'); const expectedRecvData = 'nurtzo'; // Create a TCP server -const srv = net.createServer(function(c) { +const server = net.createServer(function(c) { c.on('data', function(d) { c.write('HTTP/1.1 101\r\n'); c.write('hello: world\r\n'); @@ -49,7 +49,7 @@ const srv = net.createServer(function(c) { }); }); -srv.listen(0, '127.0.0.1', common.mustCall(function() { +server.listen(0, '127.0.0.1', common.mustCall(function() { const port = this.address().port; const headers = [ { @@ -63,7 +63,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { ['Origin', 'http://www.websocket.org'] ] ]; - const countdown = new Countdown(headers.length, () => srv.close()); + const countdown = new Countdown(headers.length, () => server.close()); headers.forEach(function(h) { const req = http.get({ diff --git a/test/parallel/test-net-error-twice.js b/test/parallel/test-net-error-twice.js index 4c2839d372fcb4..b26b825d16c15f 100644 --- a/test/parallel/test-net-error-twice.js +++ b/test/parallel/test-net-error-twice.js @@ -37,14 +37,14 @@ function ready() { } } -const srv = net.createServer(function onConnection(conn) { +const server = net.createServer(function onConnection(conn) { conn.on('error', function(err) { errs.push(err); if (errs.length > 1 && errs[0] === errs[1]) assert.fail('Should not emit the same error twice'); }); conn.on('close', function() { - srv.unref(); + server.unref(); }); serverSocket = conn; ready(); diff --git a/test/parallel/test-net-server-listen-path.js b/test/parallel/test-net-server-listen-path.js index cc7c6678b04224..99144ceb494a64 100644 --- a/test/parallel/test-net-server-listen-path.js +++ b/test/parallel/test-net-server-listen-path.js @@ -55,7 +55,7 @@ function randomPipePath() { { const handlePath = randomPipePath(); - const srv = net.createServer() + const server = net.createServer() .listen({ path: handlePath, readableAll: true, @@ -66,24 +66,24 @@ function randomPipePath() { assert.notStrictEqual(mode & fs.constants.S_IROTH, 0); assert.notStrictEqual(mode & fs.constants.S_IWOTH, 0); } - srv.close(); + server.close(); })); } // Test should emit "error" events when listening fails. { const handlePath = randomPipePath(); - const srv1 = net.createServer().listen({ path: handlePath }, () => { + const server1 = net.createServer().listen({ path: handlePath }, () => { // As the handlePath is in use, binding to the same address again should // make the server emit an 'EADDRINUSE' error. - const srv2 = net.createServer() + const server2 = net.createServer() .listen({ path: handlePath, writableAll: true, }, common.mustNotCall()); - srv2.on('error', common.mustCall((err) => { - srv1.close(); + server2.on('error', common.mustCall((err) => { + server1.close(); assert.strictEqual(err.code, 'EADDRINUSE'); assert(/^listen EADDRINUSE: address already in use/.test(err.message)); }));