Hey, guys! Does anyone know is it possible to forc...
# kotest
l
Hey, guys! Does anyone know is it possible to force StringSpec tests run with runBlockingTest, not with runBlocking?
I mean without explicitly writing
Copy code
"some test" {
   runBlockingTest { .. }
}
s
You could change the dispatcher
What does run blocking test do
l
it has method
Copy code
public interface DelayController {
   public fun advanceTimeBy(delayTimeMillis: Long): Long
}
that helps in testing
delay()
s
Ah that's right
So you can change the dispatcher in config, but I don't know if it needs to know you're in this special dispatcher or not
can you call advanceTimeBy in any suspend env ?
l
only on
suspend TestCoroutineScope.() -> Unit
which is under
DelayController
Copy code
interface TestCoroutineScope: CoroutineScope, UncaughtExceptionCaptor, DelayController ...
s
Then I think you're stuck with doing the runBlockingTest because the framework is defined on CoroutineScope
👌 1