Join Slack
Powered by
Is there a guide how to test in memory room databa...
# coroutines
c
Ciprian Grigor
01/31/2022, 4:37 PM
Is there a guide how to test in memory room database with coroutines especially using new test coroutine api added in kotlin 1.6 ?
y
yschimke
01/31/2022, 6:46 PM
Not sure about a guide, but it's generally seemed to work well.
https://github.com/yschimke/rememberwear/blob/main/wear/src/androidTest/kotlin/com/google/wear/soyted/db/RememberWearDatabaseTest.kt
Apart from runTest{} and creating it, do you need to test other specific cases?
c
Ciprian Grigor
01/31/2022, 6:52 PM
I want to test a flow query that emits data as I do operations on db basic e.g. ( test empty list, insert 2, test 2 items list)
g
gildor
02/01/2022, 2:20 PM
For flow you can use turbine, kotlinx.coroutines do not have test utils for flow
https://github.com/cashapp/turbine
5
Views
Open in Slack
Previous
Next