- Nothing yet!
- Nothing yet!
- Nothing yet!
1.2.0 - 2024-10-16
- Add
wasmWasi
target.
1.1.0 - 2024-03-06
- Add
wasmJs
target, removeiosArm32
andwatchosX86
targets. - Throw unconsumed events if scope is externally canceled.
1.0.0 - 2023-05-21
- Add
turbineScope
DSL function which is now required for usingtestIn
. This ensures that exceptions which occur within the test are no longer potentially lost.
- Failed
Turbine
s which occur while testing aFlow
(usingtest { }
) will now have their failures eagerly reported. - Build with Kotlin 1.8.22 and kotlinx.coroutines 1.7.1. Note: Future releases will not highlight the Kotlin or coroutines version unless important for some other reason.
0.13.0 - 2023-05-11
- New Kotlin/Native targets:
androidNativeArm32
androidNativeArm64
androidNativeX86
androidNativeX64
linuxArm64
watchosDeviceArm64
- Build with Kotlin 1.8.21
Note: This version has a transitive dependency on kotlinx.coroutines 1.7.0. If you are an Android user, you should be depending on kotlinx.coroutines 1.7.1 which graciously fixes a binary incompatibility with a Compose testing artifact (because they failed to heed its opt-in annotation which indicated that it was not a stable API).
- Ensure JVM classes target Java 8 rather than implicitly using the build JDK version.
- The default wall-clock timeout used to wait for an event has been increased from 1s to 3s.
- The exception thrown when no events have been received now includes the original timeout exception as its cause. This ensures the stacktrace contains the caller file and line information.
- Ensure
expectNoEvents()
fails if a completion or exception event occurred. - Differentiate timeout and cancellation exceptions thrown from Turbine's own event timeout (which are thrown) from those which occur within the flow under test (which are available via
awaitError()
).
- Build with Kotlin 1.7.20
takeItem()
no longer throws an exception when returning anull
value.await
-prefixed methods no longer interfere with virtual time control from aTestScheduler
(such as insiderunTest
).
- Support specifying a human-readable name for differentiating the failures of multiple Turbines
- Properly catch all
Throwable
subtypes from failures in flows and channels as events.
- Restore timeout support. By default a 1-second timeout will be enforced when awaiting an event. This can be customized by supplying a
timeout
argument or by using thewithTurbineTimeout
wrapper function. Timeouts will always use wall clock time even when using a virtual time dispatcher.
- When
runTest
(or anyTestCoroutineScheduler
) is in use, switch to theUnconfinedTestScheduler
internally to ensure virtual time remains working.
- Remove
ReceiveTurbine.ignoreRemainingEvents
from public API.
- Restore usage of
Unconfined
dispatcher preventing value conflation (as much as possible) so that intermediate values can always be observed.
FlowTurbine
is now calledReceiveTurbine
. This is the consume-only type with which you assert on events it has seen (historically only from aFlow
).- New public
Turbine
type implementsReceiveTurbine
but also allows you write events from a data source. Use this to implement fakes or collect events from non-Flow
streams. - Extension functions on
ReceiveChannel
provideReceiveTurbine
-like assertion capabilities. - Support for legacy JS has been removed. Only JS IR is now supported.
- Removed some APIs deprecated in 0.8.x.
- New
testIn
API allows testing multiple flows without nesting lambdas. - New
skip(Int)
API can replace one or more calls toawaitItem()
where the result is not needed.
- Removed timeout parameter. The new
runTest
API from kotlinx.coroutines enforces a timeout automatically. - Documented that flows are implicitly canceled at the end of the
test
lambda. This has been the behavior for a few versions by accident, but now it is explicit and documented. - Cancel (and friends) are now suspending functions to ensure that non-canceleable coroutines complete and their effects are observed deterministically.
- Moved APIs using Kotlin's experimental time to separate extensions. You can now use the library without worrying about incompatibilities with Kotlin version or coroutine library version.
- Removed APIs deprecated in 0.6.x.
- Support Apple silicon targets for native users.
expectMostRecentItem()
function consumes all received items and returns the most recent item.
- Functions which may suspend to wait for an event are now prefixed with 'await'.
- Support running on a background thread with Kotlin/Native.
- Support watchOS 64-bit.
- Upgrade to Kotlin 1.5.0.
- Upgrade to kotlinx.coroutines 1.5.0.
- Upgrade to Kotlin 1.5.0.
- Upgrade to kotlinx.coroutines 1.5.0-RC.
- Upgrade to kotlinx.coroutines 1.4.3.
- Removed requirement to opt-in to
@ExperimentalCoroutinesApi
.
- Upgrade to Kotlin 1.4.30.
cancelAndConsumeRemainingEvents()
cancels theFlow
and returns any unconsumed events which were already received.expectEvent()
waits for an event (item, complete, or error) and returns it as a sealed typeEvent
.
- Support Javascript IR backend.
0.2.0 - 2020-08-17
- Upgrade to Kotlin 1.4.
0.1.1 - 2020-08-03
- Use the
Unconfined
dispatcher for the internal flow collection coroutine which should eliminate the need to useyield()
in tests.
0.1.0 - 2020-08-03
Initial release