-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #466 from nimblehq/feature/465-test-shared-flow-ex…
…ecution-in-composable-with-robolectric [#465] [Compose] Optimize to test "SharedFlow" execution in Composable with Robolectric
- Loading branch information
Showing
12 changed files
with
123 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
sample-compose/app/src/test/java/co/nimblehq/sample/compose/ui/screens/BaseScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package co.nimblehq.sample.compose.ui.screens | ||
|
||
import co.nimblehq.sample.compose.test.CoroutineTestRule | ||
import kotlinx.coroutines.test.StandardTestDispatcher | ||
|
||
abstract class BaseScreenTest { | ||
|
||
protected val coroutinesRule = CoroutineTestRule() | ||
|
||
protected fun setStandardTestDispatcher() { | ||
coroutinesRule.testDispatcher = StandardTestDispatcher() | ||
} | ||
|
||
protected fun advanceUntilIdle() { | ||
coroutinesRule.testDispatcher.scheduler.advanceUntilIdle() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
template-compose/app/src/test/java/co/nimblehq/template/compose/ui/screens/BaseScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package co.nimblehq.template.compose.ui.screens | ||
|
||
import co.nimblehq.template.compose.test.CoroutineTestRule | ||
import kotlinx.coroutines.test.StandardTestDispatcher | ||
|
||
abstract class BaseScreenTest { | ||
|
||
protected val coroutinesRule = CoroutineTestRule() | ||
|
||
protected fun setStandardTestDispatcher() { | ||
coroutinesRule.testDispatcher = StandardTestDispatcher() | ||
} | ||
|
||
protected fun advanceUntilIdle() { | ||
coroutinesRule.testDispatcher.scheduler.advanceUntilIdle() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters