question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect description of project-wide testCoroutineDispatcher settings

See original GitHub issue

The 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:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sksamuelcommented, Jan 12, 2022

Actually sorry you’re right, I was looking at other config objects. This will be fixed for 5.0.4 and 5.1.0.

0reactions
iainismcommented, Dec 6, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found