Package-level declarations

Types

Link copied to clipboard
@ObjCName(name = "ReachableFakeReachability", swiftName = "FakeReachability")
class FakeReachability(initial: ReachabilityStatus = ReachabilityStatus.Unknown) : StateFlowReachability

Scriptable fake Reachability for tests.

Functions

Link copied to clipboard
@ObjCName(swiftName = "withFakeReachability")
suspend fun <R> withFakeReachability(initial: ReachabilityStatus = ReachabilityStatus.Unknown, block: suspend (FakeReachability) -> R): R

Install a fresh FakeReachability as Reachability.shared for the duration of block; restore the previous override (or null) on exit; close the fake so the supervisor scope is cancelled. Exception-safe: every step in the finally runs even when block throws.