@@ -137,13 +137,11 @@ A promise if `runSuite` is asynchronous, `void` otherwise.
137
137
``` ts
138
138
// Synchronous
139
139
const isEven = (num : number ) => num % 2 === 0 ;
140
-
141
140
describe (" isEven" , it => {
142
141
it (" should return true for multiples of 2" , expect => {
143
142
expect (isEven (2 ), toEqual (true ));
144
143
expect (isEven (100 ), toEqual (true ));
145
144
});
146
-
147
145
it (" should return true for 0" , expect => {
148
146
expect (isEven (0 ), toEqual (true ));
149
147
});
@@ -162,7 +160,6 @@ const delay = timeMilliseconds => {
162
160
setTimeout (() => resolve (), timeMilliseconds );
163
161
});
164
162
};
165
-
166
163
await describe (" delay" , async it => {
167
164
await it (" should delay by 1s" , async expect => {
168
165
const time = performance .now ();
@@ -205,7 +202,6 @@ expect(true, toEqual(true)); // PASSED
205
202
const reject = () => {
206
203
return new Promise ((_ , reject ) => reject (new Error ()));
207
204
};
208
-
209
205
await expect (reject , toReject (Error )); // PASSED
210
206
```
211
207
@@ -230,7 +226,6 @@ A promise if `test` is asynchronous, `void` otherwise.
230
226
``` ts
231
227
// Synchronous
232
228
const isEven = (num : number ) => num % 2 === 0 ;
233
-
234
229
it (" returns true if number is even" , expect => {
235
230
expect (isEven (2 ), toEqual (true )); // PASSED
236
231
// More expect
@@ -248,7 +243,6 @@ const delay = timeMilliseconds => {
248
243
setTimeout (() => resolve (), timeMilliseconds );
249
244
});
250
245
};
251
-
252
246
await it (" should delay by 1000ms" , async expect => {
253
247
const time = performance .now ();
254
248
await delay (1000 );
@@ -281,7 +275,6 @@ mod("Math", describe => {
281
275
expect (isEven (2 ), toEqual (true ));
282
276
expect (isEven (1000 ), toEqual (true ));
283
277
});
284
-
285
278
it (" should return true for 0" , expect => {
286
279
expect (isEven (0 ), toEqual (true ));
287
280
});
@@ -697,7 +690,6 @@ with the error returned by `Err`.
697
690
const reject = () => {
698
691
return new Promise ((_ , reject ) => reject (new Error (" Error occurred" )));
699
692
};
700
-
701
693
expect (reject , toReject ()); // PASSED
702
694
expect (reject , toReject (Error , " TypeError occurred" )); // FAILED
703
695
```
@@ -726,7 +718,6 @@ If `Err` is provided, it also checks if the error thrown matches `Err`.
726
718
const throwError = () => {
727
719
throw new Error ();
728
720
};
729
-
730
721
expect (throwError , toThrow (Error )); // PASSED
731
722
expect (throwError , toThrow (Error , " An unknown error occurred" )); // FAILED
732
723
```
0 commit comments