@@ -14,6 +14,10 @@ import kotlin.jvm.*
1414/* *
1515 * Executes a [testBody] inside an immediate execution dispatcher.
1616 *
17+ * This method is deprecated in favor of [runTest]. Please see the
18+ * [migration guide](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md)
19+ * for an instruction on how to update the code for the new API.
20+ *
1721 * This is similar to [runBlocking] but it will immediately progress past delays and into [launch] and [async] blocks.
1822 * You can use this to write tests that execute in the presence of calls to [delay] without causing your test to take
1923 * extra time.
@@ -45,7 +49,10 @@ import kotlin.jvm.*
4549 * then they must implement [DelayController] and [TestCoroutineExceptionHandler] respectively.
4650 * @param testBody The code of the unit-test.
4751 */
48- @Deprecated(" Use `runTest` instead to support completing from other dispatchers." , level = DeprecationLevel .WARNING )
52+ @Deprecated(" Use `runTest` instead to support completing from other dispatchers. " +
53+ " Please see the migration guide for details: " +
54+ " https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md" ,
55+ level = DeprecationLevel .WARNING )
4956// Since 1.6.0, ERROR in 1.7.0 and removed as experimental in 1.8.0
5057public fun runBlockingTest (
5158 context : CoroutineContext = EmptyCoroutineContext ,
@@ -101,8 +108,16 @@ public fun runBlockingTestOnTestScope(
101108
102109/* *
103110 * Convenience method for calling [runBlockingTest] on an existing [TestCoroutineScope].
111+ *
112+ * This method is deprecated in favor of [runTest], whereas [TestCoroutineScope] is deprecated in favor of [TestScope].
113+ * Please see the
114+ * [migration guide](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md)
115+ * for an instruction on how to update the code for the new API.
104116 */
105- @Deprecated(" Use `runTest` instead to support completing from other dispatchers." , level = DeprecationLevel .WARNING )
117+ @Deprecated(" Use `runTest` instead to support completing from other dispatchers. " +
118+ " Please see the migration guide for details: " +
119+ " https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md" ,
120+ level = DeprecationLevel .WARNING )
106121// Since 1.6.0, ERROR in 1.7.0 and removed as experimental in 1.8.0
107122public fun TestCoroutineScope.runBlockingTest (block : suspend TestCoroutineScope .() -> Unit ): Unit =
108123 runBlockingTest(coroutineContext, block)
@@ -117,8 +132,16 @@ public fun TestScope.runBlockingTest(block: suspend TestScope.() -> Unit): Unit
117132
118133/* *
119134 * Convenience method for calling [runBlockingTest] on an existing [TestCoroutineDispatcher].
135+ *
136+ * This method is deprecated in favor of [runTest], whereas [TestCoroutineScope] is deprecated in favor of [TestScope].
137+ * Please see the
138+ * [migration guide](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md)
139+ * for an instruction on how to update the code for the new API.
120140 */
121- @Deprecated(" Use `runTest` instead to support completing from other dispatchers." , level = DeprecationLevel .WARNING )
141+ @Deprecated(" Use `runTest` instead to support completing from other dispatchers. " +
142+ " Please see the migration guide for details: " +
143+ " https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md" ,
144+ level = DeprecationLevel .WARNING )
122145// Since 1.6.0, ERROR in 1.7.0 and removed as experimental in 1.8.0
123146public fun TestCoroutineDispatcher.runBlockingTest (block : suspend TestCoroutineScope .() -> Unit ): Unit =
124147 runBlockingTest(this , block)
0 commit comments