<@UCQSRLA2J> Maybe this works, given a CoroutineSc...
# coroutines
s
@Sam Maybe this works, given a CoroutineScope:
scope.coroutineContext[ContinuationInterceptor]
s
Thx, the type when used with default dispatcher is kotlinx.coroutines.scheduling.DefaultScheduler, which happens to be internal. How can i check to see if it is default? internal object DefaultScheduler
I'm trying to write a test to verify if the component is using the passed dispatcher
r
send in a mock of the dispatcher and verify that it's being used?
s
Or add your custom
Element
to the CoroutineScope's `coroutineContext`and test for that Element's presence in your test-code.
s
custom Element is fine but nothing stops in that layer from ignoring the provided dispatcher or override with a different dispatcher, and the test would pass instead of failing
s
I see. Yep, then inserting a ‘mock’ Dispatcher and checking if it is still there is the best option.
s
yeah, mock is the only way