Support mocha style callbacks in waitFor