Helper to make it simpler to write asynchronous Jasmine tests.