Skip to content

Commit 8077b89

Browse files
silverwindMylesBorins
authored andcommitted
test: fix issues for ESLint 2.7.0
PR-URL: #6132 Reviewed-By: Brian White <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: thefourtheye <[email protected]>
1 parent 3ce59ab commit 8077b89

5 files changed

+24
-28
lines changed

test/parallel/test-async-wrap-disabled-propagate-parent.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const providers = Object.keys(async_wrap.Providers);
99
const uidSymbol = Symbol('uid');
1010

1111
let cntr = 0;
12-
let server;
1312
let client;
1413

1514
function init(uid, type, parentUid, parentHandle) {
@@ -34,7 +33,7 @@ function noop() { }
3433
async_wrap.setupHooks({ init });
3534
async_wrap.enable();
3635

37-
server = net.createServer(function(c) {
36+
const server = net.createServer(function(c) {
3837
client = c;
3938
// Allow init callback to run before closing.
4039
setImmediate(() => {

test/parallel/test-async-wrap-propagate-parent.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const providers = Object.keys(async_wrap.Providers);
99
const uidSymbol = Symbol('uid');
1010

1111
let cntr = 0;
12-
let server;
1312
let client;
1413

1514
function init(uid, type, parentUid, parentHandle) {
@@ -34,7 +33,7 @@ function noop() { }
3433
async_wrap.setupHooks({ init });
3534
async_wrap.enable();
3635

37-
server = net.createServer(function(c) {
36+
const server = net.createServer(function(c) {
3837
client = c;
3938
// Allow init callback to run before closing.
4039
setImmediate(() => {

test/parallel/test-stream-writev.js

+18-19
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,24 @@ function test(decode, uncork, multi, next) {
4343
assert(false, 'Should not call _write');
4444
};
4545

46-
var expectChunks = decode ?
47-
[
48-
{ encoding: 'buffer',
49-
chunk: [104, 101, 108, 108, 111, 44, 32] },
50-
{ encoding: 'buffer',
51-
chunk: [119, 111, 114, 108, 100] },
52-
{ encoding: 'buffer',
53-
chunk: [33] },
54-
{ encoding: 'buffer',
55-
chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] },
56-
{ encoding: 'buffer',
57-
chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173]}
58-
] : [
59-
{ encoding: 'ascii', chunk: 'hello, ' },
60-
{ encoding: 'utf8', chunk: 'world' },
61-
{ encoding: 'buffer', chunk: [33] },
62-
{ encoding: 'binary', chunk: '\nand then...' },
63-
{ encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }
64-
];
46+
var expectChunks = decode ? [
47+
{ encoding: 'buffer',
48+
chunk: [104, 101, 108, 108, 111, 44, 32] },
49+
{ encoding: 'buffer',
50+
chunk: [119, 111, 114, 108, 100] },
51+
{ encoding: 'buffer',
52+
chunk: [33] },
53+
{ encoding: 'buffer',
54+
chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] },
55+
{ encoding: 'buffer',
56+
chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173]}
57+
] : [
58+
{ encoding: 'ascii', chunk: 'hello, ' },
59+
{ encoding: 'utf8', chunk: 'world' },
60+
{ encoding: 'buffer', chunk: [33] },
61+
{ encoding: 'binary', chunk: '\nand then...' },
62+
{ encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }
63+
];
6564

6665
var actualChunks;
6766
w._writev = function(chunks, cb) {

test/parallel/test-timers-immediate.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var assert = require('assert');
55
let immediateA = false;
66
let immediateB = false;
77
let immediateC = [];
8-
let before;
98

109
setImmediate(function() {
1110
try {
@@ -16,7 +15,7 @@ setImmediate(function() {
1615
clearImmediate(immediateB);
1716
});
1817

19-
before = process.hrtime();
18+
const before = process.hrtime();
2019

2120
immediateB = setImmediate(function() {
2221
immediateB = true;

test/parallel/test-timers-unref.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let timeout_fired = false;
77
let unref_interval = false;
88
let unref_timer = false;
99
let unref_callbacks = 0;
10-
let interval, check_unref, checks = 0;
10+
let checks = 0;
1111

1212
var LONG_TIME = 10 * 1000;
1313
var SHORT_TIME = 100;
@@ -28,7 +28,7 @@ setTimeout(function() {
2828
timeout_fired = true;
2929
}, LONG_TIME).unref();
3030

31-
interval = setInterval(function() {
31+
const interval = setInterval(function() {
3232
unref_interval = true;
3333
clearInterval(interval);
3434
}, SHORT_TIME);
@@ -38,7 +38,7 @@ setTimeout(function() {
3838
unref_timer = true;
3939
}, SHORT_TIME).unref();
4040

41-
check_unref = setInterval(function() {
41+
const check_unref = setInterval(function() {
4242
if (checks > 5 || (unref_interval && unref_timer))
4343
clearInterval(check_unref);
4444
checks += 1;

0 commit comments

Comments
 (0)