Browse Source

test: fix undeclared variable access

Fixes all cases of undeclared variable access as uncovered by the
no-undef rule of eslint.

PR-URL: https://github.com/nodejs/io.js/pull/1794
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
v2.3.1-release
Roman Reiss 10 years ago
parent
commit
ff8202c6f4
  1. 16
      test/parallel/test-cluster-worker-exit.js
  2. 14
      test/parallel/test-cluster-worker-kill.js
  3. 2
      test/pummel/test-net-timeout.js

16
test/parallel/test-cluster-worker-exit.js

@ -106,17 +106,13 @@ function checkResults(expected_results, results) {
var actual = results[k],
expected = expected_results[k];
if (typeof expected === 'function') {
expected(r[k]);
} else {
var msg = (expected[1] || '') +
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
var msg = (expected[1] || '') +
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
if (expected && expected.length) {
assert.equal(actual, expected[0], msg);
} else {
assert.equal(actual, expected, msg);
}
if (expected && expected.length) {
assert.equal(actual, expected[0], msg);
} else {
assert.equal(actual, expected, msg);
}
}
}

14
test/parallel/test-cluster-worker-kill.js

@ -106,16 +106,12 @@ function checkResults(expected_results, results) {
var actual = results[k],
expected = expected_results[k];
if (typeof expected === 'function') {
expected(r[k]);
var msg = (expected[1] || '') +
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
if (expected && expected.length) {
assert.equal(actual, expected[0], msg);
} else {
var msg = (expected[1] || '') +
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
if (expected && expected.length) {
assert.equal(actual, expected[0], msg);
} else {
assert.equal(actual, expected, msg);
}
assert.equal(actual, expected, msg);
}
}
}

2
test/pummel/test-net-timeout.js

@ -79,7 +79,7 @@ process.on('exit', function() {
assert.ok(starttime != null);
assert.ok(timeouttime != null);
diff = timeouttime - starttime;
var diff = timeouttime - starttime;
console.log('diff = ' + diff);
assert.ok(timeout < diff);

Loading…
Cancel
Save