I want to write a test that does something like this:
@Test
fun testingBusinessLogicThatDoesTimeouts() = runTest {
val turbine = Turbine<String>()
assertFailsWith<TimeoutCancellationException> {
withTimeout(1.seconds) {
turbine.awaitItem()
}
}
}
Unfortunately it fails like so:
Expected an exception of class kotlinx.coroutines.TimeoutCancellationException to be thrown, but was app.cash.turbine.TurbineAssertionError: No value produced in 3s