You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i do : coEvery { splashScreenRepositoryMock.getToken() }.returns("blablabla")
I have this error : Exception in thread "Test worker @coroutine#1" io.mockative.MissingExpectationException: A function was called without a matching expectation.
An expectation was not given on the function:
SplashScreenRepositoryMock.getToken()
Set up an expectation using:
coEvery { splashScreenRepositoryMock.getToken() }
.invokes { ... }
The following expectations were configured on the mock:
With : coEvery { splashScreenRepositoryMock.getToken() }.invokes { "blablabla" }
Error : Overload resolution ambiguity. All these functions match.
public open fun invokes(block: suspend () → String?): Unit defined in io.mockative.SuspendResultBuilder
public final fun invokes(block: suspend (arguments: Array<Any?>) → String?): Unit defined in io.mockative.SuspendResultBuilder
But i stille have Exception in thread "Test worker @coroutine#1" io.mockative.MissingExpectationException: A function was called without a matching expectation. If a do : coEvery { splashScreenRepositoryMock.getToken() }.invokes { -> "blablabla" } coEvery { splashScreenRepositoryMock.getToken() }.invokes { arguments -> "Résultat avec ${arguments} " }
Here my repository : interface SplashScreenRepository { suspend fun getToken(): String? suspend fun getEtape(): EtapeInscriptionEnum? }
Thank you for your help
The text was updated successfully, but these errors were encountered:
Hi,
I have a problem with the coroutine test :(
When i do :
coEvery { splashScreenRepositoryMock.getToken() }.returns("blablabla")
I have this error : Exception in thread "Test worker @coroutine#1" io.mockative.MissingExpectationException: A function was called without a matching expectation.
With :
coEvery { splashScreenRepositoryMock.getToken() }.invokes { "blablabla" }
Error : Overload resolution ambiguity. All these functions match.
public open fun invokes(block: suspend () → String?): Unit defined in io.mockative.SuspendResultBuilder
public final fun invokes(block: suspend (arguments: Array<Any?>) → String?): Unit defined in io.mockative.SuspendResultBuilder
But i stille have Exception in thread "Test worker @coroutine#1" io.mockative.MissingExpectationException: A function was called without a matching expectation. If a do :
coEvery { splashScreenRepositoryMock.getToken() }.invokes { -> "blablabla" }
coEvery { splashScreenRepositoryMock.getToken() }.invokes { arguments -> "Résultat avec ${arguments} " }
Here my repository :
interface SplashScreenRepository { suspend fun getToken(): String? suspend fun getEtape(): EtapeInscriptionEnum? }
Thank you for your help
The text was updated successfully, but these errors were encountered: