Testing asynchronous javascript code usually doesn't require a different approach to normal. You can make your unit tests be much clearer by using promises.