Skip to content

Commit 9614536

Browse files
elizarovqwwdfsad
authored andcommitted
Fixes kotlin-coroutines-test TestCoroutineDispatcher docs
Fixes #1163
1 parent 6e3faa7 commit 9614536

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kotlinx-coroutines-test/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ when the class under test allows a test to provide a [CoroutineDispatcher] but d
325325
[CoroutineScope].
326326

327327
Since [TestCoroutineDispatcher] is stateful in order to keep track of executing coroutines, it is
328-
important to ensure that [cleanupTestCoroutines][TestCoroutineDispatcher.cleanupTestCoroutines] is called after every test case.
328+
important to ensure that [cleanupTestCoroutines][DelayController.cleanupTestCoroutines] is called after every test case.
329329

330330
```kotlin
331331
class TestClass {
@@ -340,7 +340,7 @@ class TestClass {
340340
@After
341341
fun cleanUp() {
342342
Dispatchers.resetMain()
343-
testScope.cleanupTestCoroutines()
343+
testDispatcher.cleanupTestCoroutines()
344344
}
345345

346346
@Test
@@ -449,5 +449,5 @@ If you have any suggestions for improvements to this experimental API please sha
449449
[TestCoroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scope/index.html
450450
[TestCoroutineExceptionHandler]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-exception-handler/index.html
451451
[TestCoroutineScope.cleanupTestCoroutines]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scope/cleanup-test-coroutines.html
452-
[TestCoroutineDispatcher.cleanupTestCoroutines]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-dispatcher/cleanup-test-coroutines.html
452+
[DelayController.cleanupTestCoroutines]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-delay-controller/cleanup-test-coroutines.html
453453
<!--- END -->

0 commit comments

Comments
 (0)