mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Ensure _.flatten will flatten arguments objects.
Former-commit-id: 9ea8e40ff85b217a6497c9bbf91c9640211d9477
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -939,7 +939,13 @@
|
||||
QUnit.module('lodash.flatten');
|
||||
|
||||
(function() {
|
||||
var array = [{ 'a': [1, [2]] }, { 'a': [3] }];
|
||||
var args = arguments,
|
||||
array = [{ 'a': [1, [2]] }, { 'a': [3] }];
|
||||
|
||||
test('should flatten `arguments` objects', function() {
|
||||
var actual = _.flatten([args, args]);
|
||||
deepEqual(actual, [1, 2, 3, 1, 2, 3]);
|
||||
});
|
||||
|
||||
test('should work with a `callback`', function() {
|
||||
var actual = _.flatten(array, function(value) {
|
||||
@@ -1000,7 +1006,7 @@
|
||||
deepEqual(actual2, expected);
|
||||
ok(4 in actual2);
|
||||
});
|
||||
}());
|
||||
}(1, 2, 3));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user