In a unit test, using `runTest`, can I somehow tes...
# coroutines
l
In a unit test, using
runTest
, can I somehow test that coroutine suspended and not continued?
The use case is related to my thread above - I want to test
suspendCancellableCoroutine
getting a callback, which then doesn't trigger a continuation to resume
s
Something like this?
Copy code
runTest {
    val job = async { doSomething() }
    runCurrent()
    assertFalse(job.isCompleted)
    job.cancel()
}
l
That seems to work well. Thank you for your help! 🙏