I went round a few houses trying to figure out how best to test ViewModels containing LiveData using Kotlin based testing tools. My main mistakes were trying to use JUnit 5 annotations with KoTest test classes and expecting them to work. The @ExtendWith()
annotation is from the org.junit.jupiter.api.extension
package. Jupiter is the module used for writing tests, whereas KoTest runs on the JUnit 5 Platform. Very different thing apparently
I came accross this Mockk issue which pointed me towards this write up on how to test live data with JUnit 5. This gave me the code to delegate the live data executor to a custom one which simply executes immedietely.
I've not tested thi