Add test to ensure _.flatten returns empty arrays for non array-like objects.

This commit is contained in:
John-David Dalton
2014-02-22 17:19:20 -08:00
parent 1a17cbd26b
commit 0860d9712e

View File

@@ -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));
/*--------------------------------------------------------------------------*/