Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "kgo", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Flow control the super easy way", | ||
@@ -5,0 +5,0 @@ "main": "kgo.js", |
@@ -105,3 +105,3 @@ var ignoreDependency = /^\!.+/; | ||
if(noMoreTasks){ | ||
if(noMoreTasks && Object.keys(results).length === emitter._taskCount){ | ||
emitter._complete = true; | ||
@@ -115,4 +115,7 @@ emitter.emit('complete'); | ||
emitter._taskCount = Object.keys(results).length; | ||
for(var key in tasks){ | ||
todo[key] = tasks[key]; | ||
emitter._taskCount += todo[key].names.length; | ||
} | ||
@@ -119,0 +122,0 @@ |
@@ -230,2 +230,33 @@ var test = require('grape'), | ||
}); | ||
}); | ||
test('complete', function(t){ | ||
t.plan(3); | ||
var a,b,c; | ||
kgo | ||
(function(done){ | ||
setTimeout(function(){ | ||
a = 1; | ||
done(); | ||
},100); | ||
}) | ||
(function(done){ | ||
setTimeout(function(){ | ||
b = 2; | ||
done(); | ||
},100); | ||
}) | ||
(function(done){ | ||
setTimeout(function(){ | ||
c = 3; | ||
done(); | ||
},100); | ||
}) | ||
.on('complete', function(){ | ||
t.equal(a,1); | ||
t.equal(b,2); | ||
t.equal(c,3); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16400
397