-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
preserve order, make variadic and handle falsy values in concat #1436
Changes from 1 commit
f37078f
e3a341b
ee70042
1382f30
39b20e6
a0ffde8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ describe('concat', function() { | |
}, x*25); | ||
}; | ||
async.concat([1,3,2], iteratee, function(err, results){ | ||
expect(results).to.eql([1,2,1,3,2,1]); | ||
expect(results).to.eql([1,3,2,1,2,1]); | ||
expect(call_order).to.eql([1,2,3]); | ||
assert(err === null, err + " passed instead of 'null'"); | ||
done(); | ||
|
@@ -34,6 +34,19 @@ describe('concat', function() { | |
}); | ||
}); | ||
|
||
it('concat preserves order', function(done) { | ||
var arr = [30, 15]; | ||
async.concat(arr, function(x, cb) { | ||
setTimeout(function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there another way to test this besides expecting it to be a certain way after a timeout? This kind of thing leads to flaky tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, fixed. Thank you! It now uses The |
||
cb(null, x); | ||
}, x); | ||
}, function(err, result) { | ||
expect(err).to.eql(null); | ||
expect(result).to.eql(arr); | ||
done(); | ||
}) | ||
}); | ||
|
||
it('concatSeries', function(done) { | ||
var call_order = []; | ||
var iteratee = function (x, cb) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the last use of
doSeries
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. From the history, it looks like all of the other
doSeries
were converted todoLimit(<function_name>Limit, 1);
when the*Series
functions were implemented in terms of*Limit
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's time to delete it, then!