test: use eslint to fix var->const/let

Manually fix issues that eslint --fix couldn't do automatically.

PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
Gibson Fahnestock 2017-01-08 13:19:00 +00:00
parent 1ef401ce92
commit 7a0e462f9f
730 changed files with 3387 additions and 3368 deletions

View file

@ -6,12 +6,12 @@ const http = require('http');
// Simple test of Node's HTTP ServerResponse.statusCode
// ServerResponse.prototype.statusCode
var testsComplete = 0;
var tests = [200, 202, 300, 404, 451, 500];
var testIdx = 0;
let testsComplete = 0;
const tests = [200, 202, 300, 404, 451, 500];
let testIdx = 0;
var s = http.createServer(function(req, res) {
var t = tests[testIdx];
const s = http.createServer(function(req, res) {
const t = tests[testIdx];
res.writeHead(t, {'Content-Type': 'text/plain'});
console.log('--\nserver: statusCode after writeHead: ' + res.statusCode);
assert.equal(res.statusCode, t);
@ -25,7 +25,7 @@ function nextTest() {
if (testIdx + 1 === tests.length) {
return s.close();
}
var test = tests[testIdx];
const test = tests[testIdx];
http.get({ port: s.address().port }, function(response) {
console.log('client: expected status: ' + test);