mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Add flow test for handling an empty array.
This commit is contained in:
21
test/test.js
21
test/test.js
@@ -6079,17 +6079,18 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user