Skip to content

Commit

Permalink
test: fix undeclared variable access
Browse files Browse the repository at this point in the history
Fixes all cases of undeclared variable access as uncovered by the
no-undef rule of eslint.

PR-URL: #1794
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
silverwind committed Jun 11, 2015
1 parent 8732977 commit ff8202c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
16 changes: 6 additions & 10 deletions test/parallel/test-cluster-worker-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
14 changes: 5 additions & 9 deletions test/parallel/test-cluster-worker-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-net-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ff8202c

Please sign in to comment.