How to test if callbacks are called as expected in the async module?
<p>In the code below, two functions are run at the same time with the help of the async module.  Once a result is obtained for both functions, the final function dosomething3() is called.  How would I test if the proper callbacks are called?</p>

<pre><code>async.parallel([
    function(cb) {
        doSomething1(function(err, result) {
            if (err) return cb(err);    // WANT TO TEST
            cb(null, result);    //WANT TO TEST
        });
    },

    function(cb) {
        doSomething2(function(err, result) {
            if (err) return cb(err);    // WANT TO TEST
            cb(null, result);    //WANT TO TEST
        });
    }

], function(err, data) {
    if (err) return handleError(err);    //WANT TO TEST
    var result1 = data[0];
    var result2 = data[1];

    dosomething3(result1, result2, function(err) {
        if (err) return handleError(err);
        process.exit(0);
    })
});
</code></pre>