mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Add string test for _.shuffle.
Former-commit-id: 420789264a287b5431322b9871a3c1c219ff2722
This commit is contained in:
11
test/test.js
11
test/test.js
@@ -3323,6 +3323,17 @@
|
|||||||
var actual = _.shuffle({ 'a': 1, 'b': 2, 'c': 3 });
|
var actual = _.shuffle({ 'a': 1, 'b': 2, 'c': 3 });
|
||||||
deepEqual(actual.sort(), [1, 2, 3]);
|
deepEqual(actual.sort(), [1, 2, 3]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_.forEach({
|
||||||
|
'literal': 'abc',
|
||||||
|
'object': Object('abc')
|
||||||
|
},
|
||||||
|
function(collection, key) {
|
||||||
|
test('should work with a string ' + key + ' for `collection`', function() {
|
||||||
|
var actual = _.shuffle(collection);
|
||||||
|
deepEqual(actual.sort(), ['a','b', 'c']);
|
||||||
|
});
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user