Make use of _.noop more in test/test.js.

This commit is contained in:
John-David Dalton
2013-11-12 00:20:42 -08:00
parent 807d75e13a
commit 8dedc6d3dc

View File

@@ -5742,8 +5742,7 @@
_.forEach(['reduce', 'reduceRight'], function(methodName) { _.forEach(['reduce', 'reduceRight'], function(methodName) {
var array = [1, 2, 3], var array = [1, 2, 3],
func = _[methodName], func = _[methodName];
noop = function() {};
test('`_.' + methodName + '` should reduce a collection to a single value', 1, function() { test('`_.' + methodName + '` should reduce a collection to a single value', 1, function() {
var actual = func(['a', 'b', 'c'], function(accumulator, value) { var actual = func(['a', 'b', 'c'], function(accumulator, value) {
@@ -5780,7 +5779,7 @@
_.forEach(empties, function(value) { _.forEach(empties, function(value) {
try { try {
actual.push(func(value, noop)); actual.push(func(value, _.noop));
} catch(e) { } } catch(e) { }
}); });
@@ -5792,7 +5791,7 @@
var actual = _.map(empties, function(value) { var actual = _.map(empties, function(value) {
try { try {
return func(value, noop, 'x'); return func(value, _.noop, 'x');
} catch(e) { } } catch(e) { }
}); });
@@ -5800,7 +5799,7 @@
}); });
test('`_.' + methodName + '` should handle an initial `accumulator` value of `undefined`', 1, function() { test('`_.' + methodName + '` should handle an initial `accumulator` value of `undefined`', 1, function() {
var actual = func([], noop, undefined); var actual = func([], _.noop, undefined);
strictEqual(actual, undefined); strictEqual(actual, undefined);
}); });
}); });
@@ -6970,7 +6969,7 @@
setTimeout(function() { setTimeout(function() {
strictEqual(count, 2); strictEqual(count, 2);
QUnit.start(); QUnit.start();
}, 256); }, 512);
} }
else { else {
skipTest(3); skipTest(3);