From 9ce6d4b72a87fe83fc5a36eef000a47d64d84e57 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 3 Sep 2014 23:43:32 -0700 Subject: [PATCH] Add test for `_.sortBy` sorting `undefined` and `NaN` values. --- test/test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test.js b/test/test.js index ad4485efb..8babd4b5a 100644 --- a/test/test.js +++ b/test/test.js @@ -9832,16 +9832,16 @@ deepEqual(actual, stableOrder); }); - test('should work with `undefined` values', 1, function() { - var array = [undefined, 4, 1, undefined, 3, 2]; - deepEqual(_.sortBy(array, _.identity), [1, 2, 3, 4, undefined, undefined]); - }); - test('should use `_.identity` when no predicate is provided', 1, function() { var actual = _.sortBy([3, 2, 1]); deepEqual(actual, [1, 2, 3]); }); + test('should move `undefined` and `NaN` values to the end', 1, function() { + var array = [NaN, undefined, 4, 1, undefined, 3, NaN, 2]; + deepEqual(_.sortBy(array), [1, 2, 3, 4, undefined, undefined, NaN, NaN]); + }); + test('should provide the correct `callback` arguments', 1, function() { var args;