Drop boolean orders param support in _.sortByOrder.

This commit is contained in:
John-David Dalton
2015-07-09 19:42:04 -07:00
parent 2586129dcd
commit 2da1b2af1a
2 changed files with 9 additions and 13 deletions

View File

@@ -14173,18 +14173,14 @@
{ 'a': 'y', 'b': 2 }
];
test('should sort multiple properties by specified orders', 2, function() {
_.each([[false, true], ['desc', 'asc']], function(orders) {
var actual = _.sortByOrder(objects, ['a', 'b'], orders);
deepEqual(actual, [objects[3], objects[1], objects[2], objects[0]]);
});
test('should sort multiple properties by specified orders', 1, function() {
var actual = _.sortByOrder(objects, ['a', 'b'], ['desc', 'asc']);
deepEqual(actual, [objects[3], objects[1], objects[2], objects[0]]);
});
test('should sort a property in ascending order when its order is not specified', 2, function() {
_.each([[false], ['desc']], function(orders) {
var actual = _.sortByOrder(objects, ['a', 'b'], orders);
deepEqual(actual, [objects[3], objects[1], objects[2], objects[0]]);
});
test('should sort a property in ascending order when its order is not specified', 1, function() {
var actual = _.sortByOrder(objects, ['a', 'b'], ['desc']);
deepEqual(actual, [objects[3], objects[1], objects[2], objects[0]]);
});
}());