-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
I'm testing a timeout case in my test, and my stubbed service has this method func myMethod() async throws -> String.
When stubbing this method, I can use theReturn or thenThrow, but how to make my method never return?
I'm cheating in the following code by sleeping longer than the defined timeout then returning a value, but is there a cleaner way?
stub(mock) { stub in
when(stub.myMethod()).then { _ in
sleep(5)
return ""
}
}Metadata
Metadata
Assignees
Labels
No labels