(item: (typeof items)[number])
| 120 | let tooManyRunningTasksEncountered = false |
| 121 | let currentlyRunning = 0 |
| 122 | const fn = async (item: (typeof items)[number]) => { |
| 123 | currentlyRunning++ |
| 124 | if (currentlyRunning > concurrency) { |
| 125 | tooManyRunningTasksEncountered = true |
| 126 | } |
| 127 | const task = s.schedule(Promise.resolve(item)) |
| 128 | task.then(() => currentlyRunning--) // this task always succeeds by construct |
| 129 | return task |
| 130 | } |
| 131 | await s.waitFor(mapWithConcurrency(items, fn, concurrency)) |
| 132 | expect(tooManyRunningTasksEncountered).toBe(false) |
| 133 | }, |
no outgoing calls
no test coverage detected