A similar case that'd be nice to support is something like:
class SuspendingInterceptor : CoroutineTestInterceptor {
override suspend fun intercept(testFunction: CoroutineTestFunction) {
println("intercepting from SuspendingInterceptor")
testFunction()
}
}
class NonSuspendingInterceptor : TestInterceptor {
override fun intercept(testFunction: TestFunction) {
println("intercepting from NonSuspendingInterceptor")
testFunction()
}
}
class ExampleTest {
@InterceptTest val nonSuspending = NonSuspendingInterceptor()
@InterceptTest val suspending = SuspendingInterceptor()
@Test fun suspendingTest() = runTest { println("running suspendingTest") }
@Test fun nonSuspendingTest() = println("running nonSuspendingTest")
}
then have the SuspendingInterceptor pick up the suspendingTest, and NonSuspendingInterceptor pick up the nonSuspendingTest.
Originally posted by @jonapoul in #188
A similar case that'd be nice to support is something like:
then have the
SuspendingInterceptorpick up thesuspendingTest, andNonSuspendingInterceptorpick up thenonSuspendingTest.Originally posted by @jonapoul in #188