mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Add sparse array test for _#concat.
This commit is contained in:
17
test/test.js
17
test/test.js
@@ -17173,6 +17173,23 @@
|
||||
QUnit.module('lodash(...).concat');
|
||||
|
||||
(function() {
|
||||
test('should treat sparse arrays as dense', 3, function() {
|
||||
if (!isNpm) {
|
||||
var expected = [],
|
||||
wrapped = _(Array(1)).concat(Array(1)),
|
||||
actual = wrapped.value();
|
||||
|
||||
expected.push(undefined, undefined);
|
||||
|
||||
ok('0'in actual);
|
||||
ok('1' in actual);
|
||||
deepEqual(actual, expected);
|
||||
}
|
||||
else {
|
||||
skipTest(3);
|
||||
}
|
||||
});
|
||||
|
||||
test('should return a new wrapped array', 3, function() {
|
||||
if (!isNpm) {
|
||||
var array = [1],
|
||||
|
||||
Reference in New Issue
Block a user