-
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
Make async.transform actually support 2 arguments #1381
Conversation
The documentation suggests that both the `accumulator` and `callback` arguments to transform is optional. However, if both are left out (and transform therefore is called with only 2 arguments), transform crashes with a `iteratee is not a function` exception. This fixes that.
I have no idea why the two builds are failing. The coverage test claims that some internal filter.js has less coverage. Even though my change doesn't affect that. And somehow a test-case failed, after I added a test-case in another file. |
I just triggered a rebuild by closing and re-opening the issue, and now the tests are passing. You guys have an unstable test! |
Yeah, its a reoccurring issue (#1322) sorry about that. As for the PR, sure |
Also the test failing looks to be coveralls complaining that the coverage of the repo decreased for some reason |
The point would be that your current documentation states that |
…fails. To improve coverage.
The test that failed until i triggered the rebuild was: I also tried to add a new test to cover a bit of the uncovered code, and now the coverage result makes no sense, since it states that every file with changed coverage has the same or increased coverage (but somehow the overall coverage is still down). I also tried to run The decreased coverage is caused by a change in the environment. https://coveralls.io/builds/10391324/source?filename=lib%2Finternal%2FsetImmediate.js (the last time coverage was run on master) |
Thanks, yeah the retry test failing is a known issue. Thanks for pointing out the docs were inaccurate. I'll look into this coverall issue issue later, seems odd its complaining when you've added tests. Thanks for the pull request! |
The documentation suggests that both the
accumulator
andcallback
arguments to transform is optional.(https://caolan.github.io/async/docs.html#transform)
However, if both are left out (and transform therefore is called with only 2 arguments), transform crashes with a
iteratee is not a function
exception.By changing the equality check to a less than check, the transform function support the use-case where only 2 arguments are passed.