We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 728d2dc commit 5ff31eaCopy full SHA for 5ff31ea
test/parallel.js
@@ -48,12 +48,15 @@ describe('parallel', () => {
48
it('should execute tasks concurrently to a limit', () => {
49
let running = 0;
50
let maxRunning = 0;
51
+ let complete = 0;
52
+
53
let task = () => {
54
running++;
55
maxRunning = Math.max(maxRunning, running);
56
57
return promiseTools.delay(5)
58
.then(() => {
59
+ complete++;
60
running--;
61
});
62
}
@@ -64,7 +67,8 @@ describe('parallel', () => {
64
67
65
68
return promiseTools.parallelLimit(tasks, 3)
66
69
- expect(maxRunning).to.equal(3);
70
+ expect(maxRunning, "max concurrent tasks").to.equal(3);
71
+ expect(complete, "tasks run").to.equal(10);
72
73
74
0 commit comments