I was trying to refactor my Unit test file to have some asynchronous API, I was trying to have a custom expectation function as followed.