@@ -28,7 +28,7 @@ Let's imagine we wanted to sort arrays of numbers using this function:
28
28
29
29
``` js
30
30
function sort (arr ) {
31
- return [].concat (arr).sort ();
31
+ return [].concat (arr).sort ();
32
32
}
33
33
```
34
34
@@ -45,11 +45,11 @@ var g = require('chance-generators')(42);
45
45
var arrays = g .n (g .integer ({ min: - 20 , max: 20 }), g .integer ({ min: 1 , max: 20 }));
46
46
47
47
expect (function (arr ) {
48
- var sorted = sort (arr);
48
+ var sorted = sort (arr);
49
49
50
- expect (sorted, ' to have length' , arr .length )
51
- .and (' first item to be less than or equal to all' , arr)
52
- .and (' last item to be greater than or equal to all' , arr);
50
+ expect (sorted, ' to have length' , arr .length )
51
+ .and (' first item to be less than or equal to all' , arr)
52
+ .and (' last item to be greater than or equal to all' , arr);
53
53
}, ' to be valid for all' , arrays);
54
54
```
55
55
@@ -76,19 +76,19 @@ If we wanted to fix the problem, we would need to use a comparison function:
76
76
77
77
``` js
78
78
function sort (arr ) {
79
- return [].concat (arr).sort (function (a , b ) {
80
- return a - b;
81
- });
79
+ return [].concat (arr).sort (function (a , b ) {
80
+ return a - b;
81
+ });
82
82
}
83
83
```
84
84
85
85
``` js
86
86
expect (function (arr ) {
87
- var sorted = sort (arr);
87
+ var sorted = sort (arr);
88
88
89
- expect (sorted, ' to have length' , arr .length )
90
- .and (' first item to be less than or equal to all' , arr)
91
- .and (' last item to be greater than or equal to all' , arr);
89
+ expect (sorted, ' to have length' , arr .length )
90
+ .and (' first item to be less than or equal to all' , arr)
91
+ .and (' last item to be greater than or equal to all' , arr);
92
92
}, ' to be valid for all' , arrays);
93
93
```
94
94
@@ -130,9 +130,9 @@ Include the library with RequireJS the following way:
130
130
131
131
``` js#evaluate:false
132
132
define(['unexpected', 'unexpected-check'], funtion (unexpected, unexpectedCheck) {
133
- var expect = unexpected.clone();
134
- expect.use(unexpectedCheck);
135
- // Your code
133
+ var expect = unexpected.clone();
134
+ expect.use(unexpectedCheck);
135
+ // Your code
136
136
});
137
137
```
138
138
0 commit comments