From 349ec35c48b90514a574525bf75b8f6b86dad30e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 8 Apr 2016 09:46:47 -0700 Subject: [PATCH] Add flow test for handling an empty array. --- test/test.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/test.js b/test/test.js index 96ffdd1c4..39f27b88c 100644 --- a/test/test.js +++ b/test/test.js @@ -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) {