@@ -14,6 +14,10 @@ import kotlin.jvm.*
14
14
/* *
15
15
* Executes a [testBody] inside an immediate execution dispatcher.
16
16
*
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
+ *
17
21
* This is similar to [runBlocking] but it will immediately progress past delays and into [launch] and [async] blocks.
18
22
* You can use this to write tests that execute in the presence of calls to [delay] without causing your test to take
19
23
* extra time.
@@ -45,7 +49,10 @@ import kotlin.jvm.*
45
49
* then they must implement [DelayController] and [TestCoroutineExceptionHandler] respectively.
46
50
* @param testBody The code of the unit-test.
47
51
*/
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 )
49
56
// Since 1.6.0, ERROR in 1.7.0 and removed as experimental in 1.8.0
50
57
public fun runBlockingTest (
51
58
context : CoroutineContext = EmptyCoroutineContext ,
@@ -101,8 +108,16 @@ public fun runBlockingTestOnTestScope(
101
108
102
109
/* *
103
110
* 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.
104
116
*/
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 )
106
121
// Since 1.6.0, ERROR in 1.7.0 and removed as experimental in 1.8.0
107
122
public fun TestCoroutineScope.runBlockingTest (block : suspend TestCoroutineScope .() -> Unit ): Unit =
108
123
runBlockingTest(coroutineContext, block)
@@ -117,8 +132,16 @@ public fun TestScope.runBlockingTest(block: suspend TestScope.() -> Unit): Unit
117
132
118
133
/* *
119
134
* 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.
120
140
*/
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 )
122
145
// Since 1.6.0, ERROR in 1.7.0 and removed as experimental in 1.8.0
123
146
public fun TestCoroutineDispatcher.runBlockingTest (block : suspend TestCoroutineScope .() -> Unit ): Unit =
124
147
runBlockingTest(this , block)
0 commit comments