I would like to write some tests for an operator which filters button press events (see thread from yesterday). To get some inspiration for the right approach, I’ve been looking at some of the existing Kotlin Coroutine tests e.g.
kotlinx.coroutines/kotlinx-coroutines-core/common/test/TestBase.common.kt
.
Is it possible to re-use
TestBase()
my own tests? I’ve tried
import kotlin.test.*
however this package is not found, despite having the following in my Android app `build.gradle`:
implementation ‘org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3’
I’ve also tried adding a
testImplementation
line with the same, but the above import still fails.
Is re-using
TestBase()
etc. in my code not possible? Or is their a separate
testImplementation
entry I should add to my app
build.gradle
?