Skip to content

Commit

Permalink
test: remove unused variables form http tests
Browse files Browse the repository at this point in the history
The http tests seem especially prone to including unused variables.
This change removes them.

PR-URL: #4422
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  • Loading branch information
Trott committed Dec 29, 2015
1 parent 5d6f558 commit abe8a34
Show file tree
Hide file tree
Showing 29 changed files with 9 additions and 39 deletions.
1 change: 0 additions & 1 deletion test/parallel/test-http-1.0-keep-alive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var http = require('http');
var net = require('net');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-304.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var http = require('http');
var childProcess = require('child_process');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-abort-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var server = http.Server(function(req, res) {
var responseClose = false;

server.listen(common.PORT, function() {
var client = http.get({
http.get({
port: common.PORT,
headers: { connection: 'keep-alive' }

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-after-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ server.listen(common.PORT, function() {
});

function doRequest(i) {
var req = http.get({
http.get({
port: common.PORT,
path: '/request' + i
}, function(res) {
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-agent-keepalive.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var common = require('../common');
var assert = require('assert');
var http = require('http');
var Agent = require('_http_agent').Agent;
var EventEmitter = require('events').EventEmitter;

var agent = new Agent({
keepAlive: true,
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-agent-null.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
var common = require('../common');
var assert = require('assert');
var http = require('http');
var net = require('net');

var request = 0;
var response = 0;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-byteswritten.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var http = require('http');

var body = 'hello world\n';
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-client-abort2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var http = require('http');

var server = http.createServer(function(req, res) {
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-client-encoding.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var http = require('http');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-client-pipe-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// see https://github.com/joyent/node/issues/3257

var common = require('../common');
var assert = require('assert');
var http = require('http');

var server = http.createServer(function(req, res) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-default-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (common.hasCrypto) {
res.end('ok');
this.close();
}).listen(SSLPORT, function() {
var req = https.get({
https.get({
host: 'localhost',
rejectUnauthorized: false,
headers: {
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-destroyed-socket-write2.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var assert = require('assert');
// where the server has ended the socket.

var http = require('http');
var net = require('net');
var server = http.createServer(function(req, res) {
setImmediate(function() {
res.destroy();
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-eof-on-connect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var net = require('net');
var http = require('http');

Expand Down
4 changes: 1 addition & 3 deletions test/parallel/test-http-exceptions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var http = require('http');

var server = http.createServer(function(req, res) {
Expand All @@ -11,9 +10,8 @@ var server = http.createServer(function(req, res) {
});

server.listen(common.PORT, function() {
var req;
for (var i = 0; i < 4; i += 1) {
req = http.get({ port: common.PORT, path: '/busy/' + i });
http.get({ port: common.PORT, path: '/busy/' + i });
}
});

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-flush.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var http = require('http');

http.createServer(function(req, res) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var http = require('http');
var net = require('net');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-keep-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var server = http.createServer(function(req, res) {
res.end();
});

var connectCount = 0;
var agent = new http.Agent({maxSockets: 1});
var headers = {'connection': 'keep-alive'};
var name = agent.getName({ port: common.PORT });
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-localaddress-bind-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var server = http.createServer(function(req, res) {
});

server.listen(common.PORT, '127.0.0.1', function() {
var req = http.request({
http.request({
host: 'localhost',
port: common.PORT,
path: '/',
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-many-ended-pipelines.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');

// no warnings should happen!
var trace = console.trace;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-no-content-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var server = net.createServer(function(socket) {
// Neither Content-Length nor Connection
socket.end('HTTP/1.1 200 ok\r\n\r\nHello');
}).listen(common.PORT, function() {
var req = http.get({port: common.PORT}, function(res) {
http.get({port: common.PORT}, function(res) {
res.setEncoding('utf8');
res.on('data', function(chunk) {
body += chunk;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-pipeline-regr-3508.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
const net = require('net');

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var backend = http.createServer(function(req, res) {

var proxy = http.createServer(function(req, res) {
console.error('proxy req headers: ' + JSON.stringify(req.headers));
var proxy_req = http.get({
http.get({
port: BACKEND_PORT,
path: url.parse(req.url).pathname
}, function(proxy_res) {
Expand Down Expand Up @@ -56,7 +56,7 @@ function startReq() {
nlistening++;
if (nlistening < 2) return;

var client = http.get({
http.get({
port: PROXY_PORT,
path: '/test'
}, function(res) {
Expand Down
8 changes: 0 additions & 8 deletions test/parallel/test-http-raw-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ http.createServer(function(req, res) {
]);
res.end('x f o o');
}).listen(common.PORT, function() {
var expectRawHeaders = [
'Date',
'Tue, 06 Aug 2013 01:31:54 GMT',
'Connection',
'close',
'Transfer-Encoding',
'chunked'
];
var req = http.request({ port: common.PORT, path: '/' });
req.addTrailers([
['x-bAr', 'yOyOyOy'],
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-regr-gh-2821.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

const server = http.createServer(function(req, res) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-res-write-after-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var server = http.Server(function(req, res) {
});

server.listen(common.PORT, function() {
var req = http.get({port: common.PORT}, function(res) {
http.get({port: common.PORT}, function(res) {
server.close();
});
});
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-server-stale-close.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var http = require('http');
var util = require('util');
var fork = require('child_process').fork;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-timeout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var common = require('../common');
var assert = require('assert');

var http = require('http');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-unix-socket.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var http = require('http');

var status_ok = false; // status code == 200?
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http-url.parse-https.request.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var https = require('https');

var url = require('url');
var fs = require('fs');
var clientRequest;

// https options
var httpsOptions = {
Expand Down

0 comments on commit abe8a34

Please sign in to comment.