Simplify tests that mock asynchronous functions.