Incorrect description of project-wide testCoroutineDispatcher settings
See original GitHub issueThe following document contains info about testCoroutineDispatcher for project config.
https://kotest.io/docs/framework/coroutines/test-coroutine-dispatcher.html
class ProjectConfig : AbstractProjectConfig() {
override val testCoroutineDispatcher = true
}
But when I try to use the following code then there is no available override for testCoroutineDispatcher. Not sure if this is a bug (missing property) or incorrect documentation.
I’m using 5.0.0 version of the library.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
TestCoroutineDispatcher swallows exceptions #1205 - GitHub
I guess the problem is that the tests passes (printing the exception in the log) but the code in production crashes because the...
Read more >Unit Testing Coroutine Suspend Functions using ... - craigrussell
This post will describe how to achieve this so you can quickly and reliably unit test suspend functions. Setup. Gradle Dependencies. We are ......
Read more >Changelog - Kotest
To enable, set the system property kotest.framework.dump.config to true. ... Config option to enable TestCoroutineDispatchers in tests.
Read more >android - How to test a Loading Indicator with coroutines ...
Found an answer here: Migrating to the new coroutines 1.6 test APIs by Marton Braun @get:Rule val mainDispatcherRule = MainDispatcherRule() ...
Read more >Testing Kotlin coroutines on Android
Injecting test dispatchers; Setting the Main dispatcher ... val initialized = AtomicBoolean(false) ... override fun starting(description: Description) {
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually sorry you’re right, I was looking at other config objects. This will be fixed for 5.0.4 and 5.1.0.
This appears to still be an issue in 5.5.4 (or a regression?), as attempting to use
override var testCoroutineDispatcher = true
in ProjectConfig as suggested by the documentation gives a lint error'testCoroutineDispatcher' in 'AbstractProjectConfig' is final and cannot be overridden
?