0
0
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:
Roman Reiss 2015-05-29 19:28:01 +02:00
parent 8732977536
commit ff8202c6f4
3 changed files with 12 additions and 20 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);