The Android coroutine testing
docs say that if you create your own
TestScope
(e.g. to inject into the class under test), then you
must call
runTest
on that scope, because there can only be one
TestScope
instance in a test. But it doesn't say why? Doing this causes my
runTest
block to timeout and fail the test, because the class I injected the
TestScope
into uses it to
shareIn
, which never completes. So my question is what are the repercussions if I disregard this rule and instead call
runTest(testScope.testScheduler)
(which passes), rather than
testScope.runTest
as the docs suggest (which fails). Or, if I should really be using the recommended way, how do I get it to not time out for my use case?