-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispatchers.Main in androidUnitTest kmm #419
Comments
|
well actually on each before I did set androidUnitTest.dependencies {
implementation(libs.coroutines.core)
implementation(libs.coroutines.android)
implementation(libs.coroutines.test)
implementation(libs.mockk)
} but when run tests it fails with |
and if I use it like this in mockkStatic("cafe.adriel.voyager.core.model.ScreenModelKt")
every { screenModel.screenModelScope } returns testScope and private val testScope = TestScope(UnconfinedTestDispatcher()) I could run my tests |
We went with option to provider func and provide class FooScreenModel(
private val scope: ScreenModel.() -> CoroutineScope = { screenModelScope },
) : StateScreenModel<FooState>(FooState()) |
is there a way to make
PlatformMainDispatcher
actual for android instead ofDispatcher.Main.immediate
toDispatchers.Main
would not let me mockk Dispachers.Main 馃
The text was updated successfully, but these errors were encountered: