Add flow test for handling an empty array.

This commit is contained in:
John-David Dalton
2016-04-08 09:46:47 -07:00
parent 057dd5b0a8
commit 349ec35c48

View File

@@ -6079,11 +6079,11 @@
}); });
QUnit.test('`_.' + methodName + '` should return an identity function when no arguments are given', function(assert) { QUnit.test('`_.' + methodName + '` should return an identity function when no arguments are given', function(assert) {
assert.expect(3); assert.expect(6);
var combined = func();
_.times(2, function(index) {
try { try {
var combined = index ? func([]) : func();
assert.strictEqual(combined('a'), 'a'); assert.strictEqual(combined('a'), 'a');
} catch (e) { } catch (e) {
assert.ok(false, e.message); assert.ok(false, e.message);
@@ -6091,6 +6091,7 @@
assert.strictEqual(combined.length, 0); assert.strictEqual(combined.length, 0);
assert.notStrictEqual(combined, identity); assert.notStrictEqual(combined, identity);
}); });
});
QUnit.test('`_.' + methodName + '` should work with a curried function and `_.head`', function(assert) { QUnit.test('`_.' + methodName + '` should work with a curried function and `_.head`', function(assert) {
assert.expect(1); assert.expect(1);