mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: Integrate Mokkery and Turbine into KMP testing framework (#4845)
This commit is contained in:
parent
df3a094430
commit
dcbbc0823b
159 changed files with 1860 additions and 2809 deletions
|
|
@ -19,8 +19,8 @@ package org.meshtastic.core.prefs.filter
|
|||
import androidx.datastore.core.DataStore
|
||||
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
|
||||
import androidx.datastore.preferences.core.Preferences
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import dev.mokkery.every
|
||||
import dev.mokkery.mock
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import kotlinx.coroutines.test.UnconfinedTestDispatcher
|
||||
import kotlinx.coroutines.test.runTest
|
||||
|
|
@ -51,7 +51,8 @@ class FilterPrefsTest {
|
|||
scope = testScope,
|
||||
produceFile = { tmpFolder.newFile("test.preferences_pb") },
|
||||
)
|
||||
dispatchers = mockk { every { default } returns testDispatcher }
|
||||
dispatchers = mock()
|
||||
every { dispatchers.default } returns testDispatcher
|
||||
filterPrefs = FilterPrefsImpl(dataStore, dispatchers)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.meshtastic.core.prefs.notification
|
|||
import androidx.datastore.core.DataStore
|
||||
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
|
||||
import androidx.datastore.preferences.core.Preferences
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import dev.mokkery.every
|
||||
import dev.mokkery.mock
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import kotlinx.coroutines.test.UnconfinedTestDispatcher
|
||||
import kotlinx.coroutines.test.runTest
|
||||
|
|
@ -50,7 +50,8 @@ class NotificationPrefsTest {
|
|||
scope = testScope,
|
||||
produceFile = { tmpFolder.newFile("test.preferences_pb") },
|
||||
)
|
||||
dispatchers = mockk { every { default } returns testDispatcher }
|
||||
dispatchers = mock()
|
||||
every { dispatchers.default } returns testDispatcher
|
||||
notificationPrefs = NotificationPrefsImpl(dataStore, dispatchers)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue