mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Cleanup _.sortBy, _.sortByAll, _.sortByOrder, & baseSortByOrder.
This commit is contained in:
17
test/test.js
17
test/test.js
@@ -14185,10 +14185,10 @@
|
||||
}
|
||||
|
||||
var objects = [
|
||||
{ 'a': 'x', 'b': 3, c: 2 },
|
||||
{ 'a': 'y', 'b': 4, c: 1 },
|
||||
{ 'a': 'x', 'b': 1, c: 4},
|
||||
{ 'a': 'y', 'b': 2, c: 3}
|
||||
{ 'a': 'x', 'b': 3 },
|
||||
{ 'a': 'y', 'b': 4 },
|
||||
{ 'a': 'x', 'b': 1 },
|
||||
{ 'a': 'y', 'b': 2 }
|
||||
];
|
||||
|
||||
var stableOrder = [
|
||||
@@ -14209,12 +14209,9 @@
|
||||
deepEqual(actual, [objects[2], objects[0], objects[3], objects[1]]);
|
||||
});
|
||||
|
||||
test('`_.' + methodName + '` should permit function comparators', 1, function() {
|
||||
function b(obj) {
|
||||
return obj.b * obj.c;
|
||||
}
|
||||
var actual = func(objects, [b, 'a']);
|
||||
deepEqual(actual, [objects[2], objects[1], objects[0], objects[3]]);
|
||||
test('`_.' + methodName + '` should support iteratees', 1, function() {
|
||||
var actual = func(objects, ['a', function(object) { return object.b; }]);
|
||||
deepEqual(actual, [objects[2], objects[0], objects[3], objects[1]]);
|
||||
});
|
||||
|
||||
test('`_.' + methodName + '` should perform a stable sort (test in IE > 8, Opera, and V8)', 1, function() {
|
||||
|
||||
Reference in New Issue
Block a user