An Opinionated testing library for kotlin multiplatform
Ever wanted to test suspending functions from common code without hack's? This is your spot
Kotlin Version | Test Version | Coroutines Version |
---|---|---|
1.5.10 | 1.1.40 | 1.5.0-native-mt |
In your testing code, you can do the following
@Test
fun `should_test_a_suspend_function_with_no_problem`() = asyncTest {
delayForFun()
// do suspending tasks here and perform assertions on the results
}
Adding test as a dependency becomes as easy as just
kotlin {
// . . .
sourceSets {
val commonTest by getting {
dependencies {
implementation("tz.co.asoft:test-coroutines:1.1.32") // please use the latest version possible
}
}
}
}
kotlin {
// . . .
dependencies {
implementationTest("tz.co.asoft:test-coroutines:1.1.32") // please use the latest version possible
/* Or
* You can be as specific as
* tz.co.asoft:test-js:+
* tz.co.asoft:test-jvm:+
*/
}
}