Merge branch 'develop' into dla/feature/connect_sdk_to_global_notifications_ui

This commit is contained in:
David Langley 2023-09-13 21:15:03 +01:00 committed by GitHub
commit 62dedbb320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 130 additions and 155 deletions

View file

@ -32,17 +32,22 @@ import kotlin.time.Duration.Companion.seconds
* Applying this test rule ensures that the slow initialisation is not done
* inside runTest which has a short default timeout.
*/
class WarmUpRule: TestRule {
override fun apply(base: Statement, description: Description): Statement = object: Statement() {
override fun evaluate() {
runTest(timeout = 60.seconds) {
moleculeFlow(RecompositionMode.Immediate) {
// Do nothing
}.test {
awaitItem() // Await a Unit composition
}
}
base.evaluate()
class WarmUpRule : TestRule {
companion object {
init {
warmUpMolecule()
}
}
override fun apply(base: Statement, description: Description): Statement = base
}
private fun warmUpMolecule() {
runTest(timeout = 60.seconds) {
moleculeFlow(RecompositionMode.Immediate) {
// Do nothing
}.test {
awaitItem() // Await a Unit composition
}
}
}