testing-flows-with-turbine

testing-flows-with-turbine is a skill for Claude Code, Codex from skydoves/android-testing-skills. It costs 240 tokens per session (5,551 once invoked), scanned A, original, Apache-2.0.

Guidance for testing Kotlin Flow, a stream of values that can change over time, with Cash App Turbine. It provides ways to wait for individual values, errors, completion, or the absence of events.

In plain words
What is it for?
Use it to test state updates, one-time events, errors, completion, cancellation, and concurrent streams.
Why use it?
It avoids tests hanging when they collect streams that never finish, such as StateFlow or SharedFlow. It also helps check several streams in a specific order.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to test state updates, one-time events, errors, completion, cancellation, and concurrent streams.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skydoves/android-testing-skills/testing-flows-with-turbine
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add skydoves/android-testing-skills --skill testing-flows-with-turbine
Clone the repo
git clone --depth 1 https://github.com/skydoves/android-testing-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-flows-with-turbine

README.md
[![agentmods](https://agentmods.dev/badge/skills/skydoves/android-testing-skills/testing-flows-with-turbine.svg)](https://agentmods.dev/skills/skydoves/android-testing-skills/testing-flows-with-turbine)
Your own site
<a href="https://agentmods.dev/skills/skydoves/android-testing-skills/testing-flows-with-turbine"><img src="https://agentmods.dev/badge/skills/skydoves/android-testing-skills/testing-flows-with-turbine.svg" alt="Measured on agentmods" height="20"></a>
Per session 240 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,551 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00240 $0.05551
Opus 5 $0.00120 $0.02776
Sonnet 5 $0.00048 $0.01110
Haiku 4.5 $0.00024 $0.00555

Measured 8d ago against content hash e1a418a26037, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

testing-flows-with-turbine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

jvm-tests/coroutines/testing-flows-with-turbine/SKILL.md · 438 lines

How it starts

The opening of the file, as written. The whole thing — 438 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Flows With Turbine — Assert Emissions Without toList Hangs

Turbine is the canonical way to assert Flow emissions one-at-a-time, with built-in cancellation that prevents hot flows (StateFlow, SharedFlow) from hanging the test. This skill covers flow.test, the ReceiveTurbine API, turbineScope for multi-flow tests, and when raw flow.toList() actually beats Turbine. The non-Flow coroutine plumbing is ../testing-coroutines-with-runtest/SKILL.md.

When to use this skill

  • The class under test exposes a StateFlow<UiState> or SharedFlow<Event> and the test must assert each emission.
  • A test hangs on flow.toList() over a SharedFlow or StateFlow — neither completes.
  • The developer wants to assert "no more emissions for a beat" or "the next event is an error", which toList() cannot express.
  • Two flows must be observed concurrently (e.g. uiState plus a one-shot events flow) and asserted in interleaved order.
  • The build error is TurbineAssertionError: Unconsumed events found or Expected an item but found Complete/Error.
  • The developer mentions Turbine APIs: awaitItem, awaitComplete, awaitError, expectMostRecentItem, skipItems, expectNoEvents, withTurbineTimeout, turbineScope, testIn.

When NOT to use this skill

  • The test is about runTest, TestScope, Dispatchers.setMain, or virtual time. Use ../testing-coroutines-with-runtest/SKILL.md first; Turbine sits on top of runTest.
  • The flow is cold and completes deterministically, and the assertion is "the full list equals X". flow.toList() is shorter — see Decision matrix below.
  • The "flow" is actually Compose snapshot state. Read it via the test rule, not Turbine.

Prerequisites

  • Gradle: testImplementation("app.cash.turbine:turbine:1.x") (docs/CORPUS.md §G.1; R5).
  • Turbine multiplatform — JVM, Android, iOS, JS, Native, wasm. Apache 2.0, Square / Cash App.
  • The surrounding test must be a runTest { … } body (or any suspend context). flow.test { } is itself suspend.
  • For multi-flow tests, @OptIn(ExperimentalCoroutinesApi::class) because turbineScope interacts with TestScope.backgroundScope.

Read the full file on GitHub · 438 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 438 lines · 240 tokens per session scan A e1a418a26037

Subscribe to this mod's changes

testing-flows-with-turbine is a skill published in the GitHub repository skydoves/android-testing-skills (318 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 240 tokens to every session and 5,551 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.