lightsofapollo/traverse-directory — pull request #1 by sethkinast (2014-04-25 22:49:47+00:00)
Title: Don't emit "complete" until all tasks have actually completed.

Hi there,

My team was running into a problem where "complete" was firing before all the files in our directory tree had been symlinked. We tracked it down to the fact that we were running `next()` asynchronously:

````javascript
traverse.file(function(source, target, next) {
fs.unlink(target, function() {
// Async
next(TraverseDirectory.symlinkfile, source, target);
});
});
````
And traverse was reporting complete before the async operations completed. This PR should fix that behavior. I added a unit test as well (it doesn't compare the output, it simply ensures that async operations work as expected, since there are already tests around the Actions themselves).

This does mean that next() has to be called (even without an Action), but I think that was expected anyways. I fixed one unit test that didn't call next() and updated the documentation slightly.

Thanks for your time!