Skip to content

Commit 355e881

Browse files
committed
Update the docs for Dispatchers.setMain
1 parent 9c9af7f commit 355e881

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kotlinx-coroutines-test/common/src/TestDispatchers.kt

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import kotlin.jvm.*
1313
* Sets the given [dispatcher] as an underlying dispatcher of [Dispatchers.Main].
1414
* All subsequent usages of [Dispatchers.Main] will use the given [dispatcher] under the hood.
1515
*
16+
* Using [TestDispatcher] as an argument has special behavior: subsequently-called [runTest], as well as
17+
* [TestScope] and test dispatcher constructors, will use the [TestCoroutineScheduler] of the provided dispatcher.
18+
*
1619
* It is unsafe to call this method if alive coroutines launched in [Dispatchers.Main] exist.
1720
*/
1821
@ExperimentalCoroutinesApi

0 commit comments

Comments
 (0)