Skip to content

Commit

Permalink
added tests for #508 and #512
Browse files Browse the repository at this point in the history
  • Loading branch information
aearly committed May 21, 2015
1 parent e968c02 commit 651232e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/test-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -2790,6 +2790,10 @@ exports['queue pause with concurrency'] = function(test) {
test.equal(q.paused, false);
}, resume_timeout);

setTimeout(function () {
test.equal(q.running(), 2);
}, resume_timeout + 10);

setTimeout(function () {
test.same(call_order, [
'process 1', 'timeout 100',
Expand All @@ -2803,6 +2807,30 @@ exports['queue pause with concurrency'] = function(test) {
}, 800);
};

exports['queue start paused'] = function (test) {
var q = async.queue(function (task, callback) {
setTimeout(function () {
callback();
}, 10);
}, 2);
q.pause();

q.push([1, 2, 3]);

setTimeout(function () {
q.resume();
}, 10);

setTimeout(function () {
test.equal(q.running(), 2);
q.resume();
}, 15);

q.drain = function () {
test.done();
};
};

exports['queue kill'] = function (test) {
var q = async.queue(function (task, callback) {
setTimeout(function () {
Expand Down

0 comments on commit 651232e

Please sign in to comment.