turbine
A small testing library for kotlinx.coroutines Flow (by cashapp)
kotlinx.coroutines
Library support for Kotlin coroutines (by Kotlin)
turbine | kotlinx.coroutines | |
---|---|---|
8 | 59 | |
2,336 | 12,739 | |
1.0% | 0.5% | |
8.2 | 8.9 | |
5 days ago | 7 days ago | |
Kotlin | Kotlin | |
Apache License 2.0 | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
turbine
Posts with mentions or reviews of turbine.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-05-10.
-
Best practices for Unit Testing Android Apps with Mockk, Kotest and others
Much of this is now available in Mockito. Even more - naturally Kotlin doesn’t have static methods, and it’s a good practice not to create them. Ideal code is code that follows the SOLID and Clean Architecture principles, which means it can be easily mocked and tested. Therefore, we, Android developers, don’t need PowerMock’s special features but it’s important to remember that such frameworks exist. Another Mockito’s limitation concerns work with coroutines and flows. In such cases, once again, mockito-kotlin as well as third-party libraries like turbine will help you out. This being said, I’d like to tell you about another alternative to Mockito, which is Mockk.
-
As an Android dev - which of these topics do you feel like you’re struggling the most with? What skills would you like to improve?
All you need: https://github.com/cashapp/turbine
-
Testing Kotlin Flows on Coroutines 1.6
You've essentially converged on what Turbine does.
- I'm getting an error that 'child jobs have not finished yet' while executing this test case. But i'm making sure that my child coroutine finishes before asserting the result. Any ideas?
-
Updating my tech stack: RxJava vs Flow
Turbine is an excellent library for testing flows and is pretty much required imo. But overall Rx is much easier to test; debugging works much more consistently and the built in testing functions are great.
-
JVM Testing Newsletter | July 2021
turbine release 0.6.0
-
Testing StateFlow
This issue on how StateFlows should be tested is probably also worth reading: https://github.com/cashapp/turbine/issues/19
-
From RxJava to Kotlin Flow: Testing
Use https://github.com/cashapp/turbine
kotlinx.coroutines
Posts with mentions or reviews of kotlinx.coroutines.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-01-10.
-
Gradle: from Newbie to Strong fundamentals
Now, let's consider an example. For instance, let's create a Kotlin/JVM project with kotlinx.coroutines library as a dependency.
-
Add `statefulMap` and `statefulTransform` operator to Kotlin coroutines' Flow
Greetings community, I just submited a PR to Kotlin coroutines with two additional operators :
-
Should I choose Kotlin over Java for a new project (backend)?
The harder parts of Kotlin are going to be things like kotlinx.coroutines, but that's just a library, not a core part of the language. It's about as hard to learn as a comparable library in another language, like the Task Parallel Library in .NET.
- kotlinx.coroutines 1.7.0 released
- Is it ok to have global scopes when the coroutine I'm starting has *nothing* to do with showing UI, nor do I care about its result?
- Release 1.7.0-Beta · Kotlin/kotlinx.coroutines
- Does the documentation of async{} and launch{} apply to each other? (Aside from the difference that async {} returned a Deferred)
-
Reactive Backend Applications with Spring Boot, Kotlin and Coroutines (Part 2)
Kotlin has coroutines that are supported by the language and implemented by a library (the implementation remains platform-dependent): kotlinx.coroutines and a sandbox environment is available here to try it out.
- Kotlinx Coroutines for Kotlin 1.7.x
-
Get value from coroutine function
That said, since it seems like you're doing UI stuff (Android?), you're best off doing all of the UI code in coroutines, using Dispatchers.Main as a context (as provided by one of the platform-specific coroutine libraries), since this will guarantee that your UI code will be safely run in the UI thread.