diff options
author | Alexander Early <alexander.early@gmail.com> | 2017-04-06 22:34:11 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2017-04-06 22:34:11 -0700 |
commit | 291c81138258cd22be3a9bc9b2f1990eacaba634 (patch) | |
tree | 03405c706a6a542fb395bc68844d3a63b73a5bc7 /mocha_test/queue.js | |
parent | 3dc9f8f1e120f0c95f67221ac0d1a9bac7b88cd4 (diff) | |
download | async-linked-list-methods.tar.gz |
add queue.removelinked-list-methods
Diffstat (limited to 'mocha_test/queue.js')
-rw-r--r-- | mocha_test/queue.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mocha_test/queue.js b/mocha_test/queue.js index cc72c52..77d4710 100644 --- a/mocha_test/queue.js +++ b/mocha_test/queue.js @@ -761,5 +761,24 @@ describe('queue', function(){ q.push('foo4', function () {calls.push('foo4 cb');}); }); }); + + it('remove', function(done) { + var result = []; + var q = async.queue(function(data, cb) { + result.push(data); + async.setImmediate(cb); + }); + + q.push([1, 2, 3, 4, 5]); + + q.remove(function (node) { + return node.data === 3; + }); + + q.drain = function () { + expect(result).to.eql([1, 2, 4, 5]); + done(); + } + }); }); |