Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast path eachOf array case #1246

Merged
merged 2 commits into from
Jul 21, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add infinity case tests for eachOfLimit
  • Loading branch information
megawac committed Jul 21, 2016
commit 910106f50ce4d3afb598625115d76c6b0e187bca
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