Dan T
07/23/2021, 8:31 PMeventually
, which looked like this:
fun <T> eventually(duration: Duration, f: () -> T): T = eventually(duration, Exception::class.java, f)
The current implementation looks like this:
suspend fun <T> eventually(duration: Duration, f: suspend () -> T): T
A couple questions around this:
1. In the past I've typically just sprinkled runBlocking
into test coroutine-related functions. It looks like kotest's test framework puts everything being tested in a coroutine context via the TestContext
. Are there any design docs or articles on that? I'm curious about why that is.
2. For a project that's not using coroutines, are there any suggested idioms/examples on how to be able to cleanly use things like eventually
in a junit 5 oriented test framework?LeoColman
07/23/2021, 8:41 PMDan T
07/23/2021, 8:47 PMsam
07/24/2021, 1:35 AM