Skip to content

Commit 62f225d

Browse files
authored
Merge pull request #4 from iamstolis/patch-1
Function in "sort with a function" test should be a comparator
2 parents 2db2ea2 + fe0290f commit 62f225d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('arraySort', function() {
120120
var arr = [{key: 'y'}, {key: 'z'}, {key: 'x'}];
121121

122122
var actual = arraySort(arr, function(a, b) {
123-
return a.key > b.key;
123+
return a.key < b.key ? -1 : (a.key > b.key ? 1 : 0);
124124
});
125125

126126
actual.should.eql([

0 commit comments

Comments
 (0)