Skip to content

Commit

Permalink
Fixes kotlin-coroutines-test TestCoroutineDispatcher docs
Browse files Browse the repository at this point in the history
Fixes #1163
  • Loading branch information
elizarov authored and qwwdfsad committed May 6, 2019
1 parent 6e3faa7 commit 9614536
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kotlinx-coroutines-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ when the class under test allows a test to provide a [CoroutineDispatcher] but d
[CoroutineScope].

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

```kotlin
class TestClass {
Expand All @@ -340,7 +340,7 @@ class TestClass {
@After
fun cleanUp() {
Dispatchers.resetMain()
testScope.cleanupTestCoroutines()
testDispatcher.cleanupTestCoroutines()
}

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

0 comments on commit 9614536

Please sign in to comment.