Skip to content

Commit 91d8a60

Browse files
committed
Fix .jshintrc and the sorting test case
1 parent 4be8c88 commit 91d8a60

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎.jshintrc‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"maxcomplexity": 9,
2727
"maxlen": 80,
2828
"globals": {
29-
"window": true
29+
"window": true,
30+
"it": true,
31+
"beforeEach": true,
32+
"describe": true,
33+
"expect": true
3034
}
3135
}

‎test/sorting/sort.testcase.js‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = function (sort, algorithmName) {
2+
3+
'use strict';
4+
25
describe(algorithmName, function () {
36

47
function createRandomArray(options) {
@@ -9,7 +12,8 @@ module.exports = function (sort, algorithmName) {
912

1013
var result = [];
1114
for (var i = size; i > 0; i -= 1) {
12-
result.push(parseFloat((Math.random() * multiplier).toFixed(precision)));
15+
result.push(parseFloat((Math.random() *
16+
multiplier).toFixed(precision)));
1317
}
1418
return result;
1519
}
@@ -19,7 +23,7 @@ module.exports = function (sort, algorithmName) {
1923
});
2024

2125
it('should work with sorted arrays', function () {
22-
expect(sort([1,2,3,4])).toEqual([1,2,3,4]);
26+
expect(sort([1, 2, 3, 4])).toEqual([1, 2, 3, 4]);
2327
});
2428

2529
it('should work with random non-sorted arrays', function () {
@@ -32,7 +36,8 @@ module.exports = function (sort, algorithmName) {
3236
}
3337
});
3438

35-
it('should sort the numbers in descending order when such comparator is provided', function () {
39+
it('should sort the numbers in descending order ' +
40+
'when such comparator is provided', function () {
3641
function comparator(a, b) {
3742
return b - a;
3843
}

0 commit comments

Comments
 (0)