Initialize DataStore with `TestScope.backgroundScope` in unit tests

Fixes #1647
pull/1648/head
Simon Marquis 3 months ago
parent c4ebde1fc2
commit 3e8d522aa8

@ -73,7 +73,7 @@ class OfflineFirstNewsRepositoryTest {
@Before
fun setup() {
niaPreferencesDataSource = NiaPreferencesDataSource(
tmpFolder.testUserPreferencesDataStore(testScope),
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
)
newsResourceDao = TestNewsResourceDao()
topicDao = TestTopicDao()

@ -60,7 +60,7 @@ class OfflineFirstTopicsRepositoryTest {
topicDao = TestTopicDao()
network = TestNiaNetworkDataSource()
niaPreferences = NiaPreferencesDataSource(
tmpFolder.testUserPreferencesDataStore(testScope),
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
)
synchronizer = TestSynchronizer(niaPreferences)

@ -51,7 +51,7 @@ class OfflineFirstUserDataRepositoryTest {
@Before
fun setup() {
niaPreferencesDataSource = NiaPreferencesDataSource(
tmpFolder.testUserPreferencesDataStore(testScope),
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
)
subject = OfflineFirstUserDataRepository(

@ -40,7 +40,7 @@ class NiaPreferencesDataSourceTest {
@Before
fun setup() {
subject = NiaPreferencesDataSource(
tmpFolder.testUserPreferencesDataStore(testScope),
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
)
}

Loading…
Cancel
Save