Skip to content

Commit

Permalink
test: fix issues for ESLint 2.7.0
Browse files Browse the repository at this point in the history
PR-URL: #6132
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: thefourtheye <thechargingvolcano@gmail.com>
  • Loading branch information
silverwind authored and Myles Borins committed Apr 20, 2016
1 parent d9b8758 commit c0e9c94
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
3 changes: 1 addition & 2 deletions test/parallel/test-async-wrap-disabled-propagate-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const providers = Object.keys(async_wrap.Providers);
const uidSymbol = Symbol('uid');

let cntr = 0;
let server;
let client;

function init(uid, type, parentUid, parentHandle) {
Expand All @@ -34,7 +33,7 @@ function noop() { }
async_wrap.setupHooks({ init });
async_wrap.enable();

server = net.createServer(function(c) {
const server = net.createServer(function(c) {
client = c;
// Allow init callback to run before closing.
setImmediate(() => {
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-async-wrap-propagate-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const providers = Object.keys(async_wrap.Providers);
const uidSymbol = Symbol('uid');

let cntr = 0;
let server;
let client;

function init(uid, type, parentUid, parentHandle) {
Expand All @@ -34,7 +33,7 @@ function noop() { }
async_wrap.setupHooks({ init });
async_wrap.enable();

server = net.createServer(function(c) {
const server = net.createServer(function(c) {
client = c;
// Allow init callback to run before closing.
setImmediate(() => {
Expand Down
37 changes: 18 additions & 19 deletions test/parallel/test-stream-writev.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,24 @@ function test(decode, uncork, multi, next) {
assert(false, 'Should not call _write');
};

var expectChunks = decode ?
[
{ encoding: 'buffer',
chunk: [104, 101, 108, 108, 111, 44, 32] },
{ encoding: 'buffer',
chunk: [119, 111, 114, 108, 100] },
{ encoding: 'buffer',
chunk: [33] },
{ encoding: 'buffer',
chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] },
{ encoding: 'buffer',
chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173]}
] : [
{ encoding: 'ascii', chunk: 'hello, ' },
{ encoding: 'utf8', chunk: 'world' },
{ encoding: 'buffer', chunk: [33] },
{ encoding: 'binary', chunk: '\nand then...' },
{ encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }
];
var expectChunks = decode ? [
{ encoding: 'buffer',
chunk: [104, 101, 108, 108, 111, 44, 32] },
{ encoding: 'buffer',
chunk: [119, 111, 114, 108, 100] },
{ encoding: 'buffer',
chunk: [33] },
{ encoding: 'buffer',
chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] },
{ encoding: 'buffer',
chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173]}
] : [
{ encoding: 'ascii', chunk: 'hello, ' },
{ encoding: 'utf8', chunk: 'world' },
{ encoding: 'buffer', chunk: [33] },
{ encoding: 'binary', chunk: '\nand then...' },
{ encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }
];

var actualChunks;
w._writev = function(chunks, cb) {
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-timers-immediate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var assert = require('assert');
let immediateA = false;
let immediateB = false;
let immediateC = [];
let before;

setImmediate(function() {
try {
Expand All @@ -16,7 +15,7 @@ setImmediate(function() {
clearImmediate(immediateB);
});

before = process.hrtime();
const before = process.hrtime();

immediateB = setImmediate(function() {
immediateB = true;
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-timers-unref.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let timeout_fired = false;
let unref_interval = false;
let unref_timer = false;
let unref_callbacks = 0;
let interval, check_unref, checks = 0;
let checks = 0;

var LONG_TIME = 10 * 1000;
var SHORT_TIME = 100;
Expand All @@ -28,7 +28,7 @@ setTimeout(function() {
timeout_fired = true;
}, LONG_TIME).unref();

interval = setInterval(function() {
const interval = setInterval(function() {
unref_interval = true;
clearInterval(interval);
}, SHORT_TIME);
Expand All @@ -38,7 +38,7 @@ setTimeout(function() {
unref_timer = true;
}, SHORT_TIME).unref();

check_unref = setInterval(function() {
const check_unref = setInterval(function() {
if (checks > 5 || (unref_interval && unref_timer))
clearInterval(check_unref);
checks += 1;
Expand Down

0 comments on commit c0e9c94

Please sign in to comment.