On this page
Overview
Turbine is a small testing library for kotlinx.coroutines Flow. It connects a Flow to a test Turbine so items, completion, and failures can be awaited and asserted in event order.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Assert Flow events with await-style APIs
Inside Flow.test, awaitItem(), awaitComplete(), and awaitError() turn asynchronous Flow events into an explicit assertion sequence.
Sources: [2]
Use testIn when scenarios need multiple Turbines
testIn creates Turbines within a CoroutineScope so multiple streams can be awaited independently in the same test scenario.
Sources: [2]
Best fit
Fits unit tests for Kotlin code that exposes StateFlow or Flow
Android ViewModels, repositories, and other coroutine-based components can verify state and event sequences without hand-written collection and synchronization logic.
Sources: [2]
Before adoption
Official sources
- [1]cashapp/turbine — GitHub repository(2026-10-06)
- [2]Turbine 1.2.1 — README(2026-10-06)
- [3]Turbine 1.2.1 release(2026-10-06)
- [4]Turbine Apache-2.0 license(2026-10-06)
Supplemental curator note
Turbine turns Flow collection tests into a readable event-awaiting DSL instead of manual collection and synchronization. Recheck behavior when upgrading kotlinx.coroutines because Turbine currently depends on an unstable API from its test artifact.
Try it in 3 steps
- 1
Add Turbine 1.2.1 as a test dependency
Add the reviewed stable 1.2.1 artifact from Maven Central to test dependencies.
testImplementation("app.cash.turbine:turbine:1.2.1") - 2
Assert Flow items and completion in order
Use the minimal README example to await two Flow items and normal completion in sequence.
flowOf("one", "two").test { assertEquals("one", awaitItem()) assertEquals("two", awaitItem()) awaitComplete() } - 3
Run the unit tests
Run the project JVM unit tests and confirm the Turbine Flow test passes.
./gradlew test
Growth
Growth trends · Last 30 days
2,863 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 5
- Open PRs
- 6
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
- Stars
- 2,863
- Forks
- 137
- Watchers
- 21
- Open issues
- 12
- Contributors
- 34
- Owner type
- Organization
- Primary language
- Kotlin
- License
- Apache-2.0
- Repository last updated
- Sep 25, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Kotest4,789 Stars
3 shared tag(s) · 2 shared category(s) · Same language
combine spec styles, assertions, and property testing across Kotlin projects
Kotlin - Paparazzi2,632 Stars
2 shared tag(s) · 2 shared category(s) · Same language
render Android Views and Compose without an emulator and compare snapshot goldens
Kotlin - Jest45,500 Stars
2 shared tag(s) · 2 shared category(s)
Combine assertions, mocks, watch mode, snapshots, coverage, and worker isolation in one JavaScript test runner
TypeScript - Testify26,222 Stars
2 shared tag(s) · 2 shared category(s)
augment Go's standard testing package with assertions, mocks, and suites
Go - Catch221,508 Stars
2 shared tag(s) · 2 shared category(s)
write C++ unit tests, BDD scenarios, and micro-benchmarks in one test framework and integrate them with CMake and CTest
C++ - Vitest17,184 Stars
2 shared tag(s) · 2 shared category(s)
reuse Vite transforms and configuration across Node, DOM, and Browser Mode tests
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.