mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
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>
This commit is contained in:
parent
8732977536
commit
ff8202c6f4
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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…
Reference in New Issue
Block a user