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