diff --git a/test/test.js b/test/test.js index 9fdc99b15..2a4e02a8e 100644 --- a/test/test.js +++ b/test/test.js @@ -646,6 +646,15 @@ var array = [1, 2, 3]; deepEqual(_.initial(array, 0), []); }); + + test('should allow a falsey `array` argument', function() { + _.each(falsey, function(index, value) { + try { + var actual = index ? _.initial(value) : _.initial(); + } catch(e) { } + deepEqual(actual, []); + }) + }); }()); /*--------------------------------------------------------------------------*/ @@ -1291,6 +1300,21 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.rest'); + + (function() { + test('should allow a falsey `array` argument', function() { + _.each(falsey, function(index, value) { + try { + var actual = index ? _.rest(value) : _.rest(); + } catch(e) { } + deepEqual(actual, []); + }) + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.size'); (function() {