You've got a number of problems. The first is that you're not passing the correct arguments to async.series
. It expects:
async.series([functions...], callback)
while you're calling
async.series(function, function)
Since the length
attribute of the first function is undefined, it assumes its an empty array and skips straight to the "callback" (second function). It sounds like you may want to pass an array of two functions and omit the callback.
The second problem is that functions passed to async.series
must call a callback in order for progression to continue. The callback is the first argument to each function:
testFunction: () ->
console.log "testFunction"
async.series([
((next) ->
console.log "first"
next()
),
((next) ->
console.log "second"
next()
)
])
async
ignores the return value of most (all?) functions that you pass to it.