@@ -42,7 +42,7 @@ describe(Async.name, () => {
42
42
43
43
const fn : ( item : number ) => Promise < string > = async ( item ) => {
44
44
running ++ ;
45
- await Async . sleep ( 1 ) ;
45
+ await Async . sleep ( 0 ) ;
46
46
maxRunning = Math . max ( maxRunning , running ) ;
47
47
running -- ;
48
48
return `result ${ item } ` ;
@@ -137,7 +137,7 @@ describe(Async.name, () => {
137
137
138
138
const fn : ( item : number ) => Promise < void > = jest . fn ( async ( item ) => {
139
139
running ++ ;
140
- await Async . sleep ( 1 ) ;
140
+ await Async . sleep ( 0 ) ;
141
141
maxRunning = Math . max ( maxRunning , running ) ;
142
142
running -- ;
143
143
} ) ;
@@ -155,7 +155,7 @@ describe(Async.name, () => {
155
155
156
156
const fn : ( item : number ) => Promise < void > = jest . fn ( async ( item ) => {
157
157
running ++ ;
158
- await Async . sleep ( 1 ) ;
158
+ await Async . sleep ( 0 ) ;
159
159
maxRunning = Math . max ( maxRunning , running ) ;
160
160
running -- ;
161
161
} ) ;
@@ -171,14 +171,14 @@ describe(Async.name, () => {
171
171
array . push ( i ) ;
172
172
}
173
173
174
- await Async . forEachAsync ( array , async ( ) => await Async . sleep ( 1 ) , { concurrency : 3 } ) ;
174
+ await Async . forEachAsync ( array , async ( ) => await Async . sleep ( 0 ) , { concurrency : 3 } ) ;
175
175
} ) ;
176
176
177
177
it ( 'rejects if any operation rejects' , async ( ) => {
178
178
const array : number [ ] = [ 1 , 2 , 3 ] ;
179
179
180
180
const fn : ( item : number ) => Promise < void > = jest . fn ( async ( item ) => {
181
- await Async . sleep ( 1 ) ;
181
+ await Async . sleep ( 0 ) ;
182
182
if ( item === 3 ) throw new Error ( 'Something broke' ) ;
183
183
} ) ;
184
184
@@ -223,7 +223,7 @@ describe(Async.name, () => {
223
223
} ;
224
224
225
225
await expect ( ( ) =>
226
- Async . forEachAsync ( syncIterable , async ( item ) => await Async . sleep ( 1 ) )
226
+ Async . forEachAsync ( syncIterable , async ( item ) => await Async . sleep ( 0 ) )
227
227
) . rejects . toThrow ( expectedError ) ;
228
228
} ) ;
229
229
@@ -245,7 +245,7 @@ describe(Async.name, () => {
245
245
} ;
246
246
247
247
await expect ( ( ) =>
248
- Async . forEachAsync ( syncIterable , async ( item ) => await Async . sleep ( 1 ) )
248
+ Async . forEachAsync ( syncIterable , async ( item ) => await Async . sleep ( 0 ) )
249
249
) . rejects . toThrow ( expectedError ) ;
250
250
} ) ;
251
251
@@ -285,7 +285,7 @@ describe(Async.name, () => {
285
285
) ;
286
286
287
287
// Wait for all the instant resolutions to be done
288
- await Async . sleep ( 1 ) ;
288
+ await Async . sleep ( 0 ) ;
289
289
expect ( waitingIterators ) . toEqual ( expectedConcurrency ) ;
290
290
resolve2 ( { done : true , value : undefined } ) ;
291
291
await finalPromise ;
@@ -309,7 +309,7 @@ describe(Async.name, () => {
309
309
} ;
310
310
311
311
await expect ( ( ) =>
312
- Async . forEachAsync ( syncIterable , async ( item ) => await Async . sleep ( 1 ) )
312
+ Async . forEachAsync ( syncIterable , async ( item ) => await Async . sleep ( 0 ) )
313
313
) . rejects . toThrow ( expectedError ) ;
314
314
} ) ;
315
315
} ) ;
@@ -516,7 +516,7 @@ describe(AsyncQueue.name, () => {
516
516
queue ,
517
517
async ( [ item , callback ] ) => {
518
518
// Add an async tick to ensure that the queue is actually running concurrently
519
- await Async . sleep ( 1 ) ;
519
+ await Async . sleep ( 0 ) ;
520
520
seenItems ++ ;
521
521
expect ( expectedItems . has ( item ) ) . toBe ( true ) ;
522
522
expectedItems . delete ( item ) ;
@@ -543,7 +543,7 @@ describe(AsyncQueue.name, () => {
543
543
queue ,
544
544
async ( [ item , callback ] ) => {
545
545
// Add an async tick to ensure that the queue is actually running concurrently
546
- await Async . sleep ( 1 ) ;
546
+ await Async . sleep ( 0 ) ;
547
547
seenItems ++ ;
548
548
if ( item < 4 ) {
549
549
expect ( expectedItems . has ( item ) ) . toBe ( true ) ;
@@ -577,7 +577,7 @@ describe(AsyncQueue.name, () => {
577
577
queue ,
578
578
async ( [ item , callback ] ) => {
579
579
// Add an async tick to ensure that the queue is actually running concurrently
580
- await Async . sleep ( 1 ) ;
580
+ await Async . sleep ( 0 ) ;
581
581
seenItems ++ ;
582
582
if ( item < 4 ) {
583
583
expect ( expectedItems . has ( item ) ) . toBe ( true ) ;
0 commit comments