mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Ensure _.concat casts non-array array values to arrays.
This commit is contained in:
16
test/test.js
16
test/test.js
@@ -3096,6 +3096,22 @@
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
QUnit.test('should cast non-array `array` values to arrays', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var values = [true, false, 1, NaN, 'a'];
|
||||
|
||||
var expected = lodashStable.map(values, function(value) {
|
||||
return [value, 2, [3]]
|
||||
});
|
||||
|
||||
var actual = lodashStable.map(values, function(value) {
|
||||
return _.concat(value, [2], [[3]]);
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
QUnit.test('should treat sparse arrays as dense', function(assert) {
|
||||
assert.expect(3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user