From 0860d9712e886bf561dc57e41acb6cc05b8a14a4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 22 Feb 2014 17:19:20 -0800 Subject: [PATCH] Add test to ensure `_.flatten` returns empty arrays for non array-like objects. --- test/test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test.js b/test/test.js index dd3cf7a6d..3ffb3afe2 100644 --- a/test/test.js +++ b/test/test.js @@ -2625,6 +2625,11 @@ deepEqual(_.flatten(array, true), expected); }); + + test('should return an empty array for non array-like objects', 1, function() { + var actual = _.flatten({ 'a': 1 }, _.identity); + deepEqual(actual, []); + }); }(1, 2, 3)); /*--------------------------------------------------------------------------*/