How to unit test async functions with Jasmine?

Please have a look at the question which is posted on SO.

Thank you.