Skip to content

Commit

Permalink
Add infinity case tests for eachOfLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
megawac committed Jul 21, 2016
1 parent aa5673e commit 910106f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mocha_test/eachOf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var async = require('../lib');
var expect = require('chai').expect;
var assert = require('assert');
var _ = require('lodash');

describe("eachOf", function() {

Expand Down Expand Up @@ -261,6 +262,18 @@ describe("eachOf", function() {
setTimeout(done, 25);
});

it('forEachOfLimit no limit', function(done) {
var count = 0;
async.forEachOfLimit(_.range(100), Infinity, function(x, i, callback){
count++;
callback();
}, function(err){
if (err) throw err;
expect(count).to.equal(100);
});
setTimeout(done, 25);
});

it('forEachOfLimit error', function(done) {
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
var call_order = [];
Expand Down

0 comments on commit 910106f

Please sign in to comment.