Does not cooperate well with runTest
See original GitHub issueWhen using turbine to test flows, delays are not skipped which causes tests to run with full delays. I would expect turbine to skip the delays.
Tested with:
- Turbine 0.8.0
- Coroutines 1.6.3
Reproducer:
@Test
fun turbineDelay() {
val delayingFlow = flow {
delay(2.seconds)
emit(Unit)
}
measureTime {
runTest {
delayingFlow.test {
awaitItem()
awaitComplete()
}
}
}.also { println("turbine test took $it") }
measureTime {
runTest {
delayingFlow.collect()
}
}.also { println("regular runTest took $it") }
}
This prints on my machine:
turbine test took 2.061758791s
regular runTest took 2.227208ms
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
A 12-Minute Run to Check Aerobic Fitness - Cooper Test
The Cooper test, a 12-minute run test, is a basic test used by coaches, trainers, and athletes to assess their current fitness and...
Read more >Run jest for unit tests of modified files only | by SunCommander
The problem with this option is that once you commit or push your changes, it won't be able to find changed files so...
Read more >dbunit - gradle test doesn't work well - Stack Overflow
When I run test in IntelliJ, it works well, but if I run it by command line like. gradle test or gradle clean...
Read more >Testing Kotlin coroutines on Android
runTest is a coroutine builder designed for testing. Use this to wrap any tests that include coroutines. Note that coroutines can be started...
Read more >unittest — Unit testing framework — Python 3.11.1 ...
Only run test methods and classes that match the pattern or substring. This option may be used multiple times, in which case all...
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
Yes, thanks!
It releases when it releases.