@@ -47,9 +47,9 @@ import kotlin.time.Duration.Companion.milliseconds
4747 * A [testTimeout] may be specified to override the default [WORKFLOW_TEST_DEFAULT_TIMEOUT_MS] for
4848 * any particular test. This is the max amount of time the test could spend waiting on a rendering.
4949 *
50- * [WorkflowRuntimeTeardown.CancelAndAwait] means `renderForTest` will not return until the workflow
51- * runtime has been cancelled and cancellation cleanup has either completed or timed out. This is the
52- * default so callers can run external teardown checks after this function returns .
50+ * By default, `renderForTest` cancels the workflow runtime and returns without waiting for
51+ * cancellation cleanup. Pass [WorkflowRuntimeTeardown.CancelAndAwait] to wait until cancellation
52+ * cleanup has either completed or timed out .
5353 *
5454 * This will start the Workflow runtime (with params as passed) rooted at whatever Workflow
5555 * it is called on and then create a [WorkflowTurbine] for its renderings and run [testCase] on that.
@@ -63,7 +63,7 @@ public fun <PropsT, StateT, OutputT, RenderingT>
6363 props : StateFlow <PropsT >,
6464 testParams : WorkflowTestParams <StateT > = WorkflowTestParams (),
6565 coroutineContext : CoroutineContext = StandardTestDispatcher (),
66- teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .CancelAndAwait () ,
66+ teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .Cancel ,
6767 onOutput : suspend (OutputT ) -> Unit = {},
6868 testTimeout : Long = WORKFLOW_TEST_DEFAULT_TIMEOUT_MS ,
6969 testCase : suspend WorkflowTurbine <RenderingT , OutputT >.() -> Unit
@@ -207,7 +207,7 @@ public fun <StateT, OutputT, RenderingT>
207207 StatefulWorkflow <Unit , StateT , OutputT , RenderingT >.renderForTest (
208208 testParams : WorkflowTestParams <StateT > = WorkflowTestParams (),
209209 coroutineContext : CoroutineContext = StandardTestDispatcher (),
210- teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .CancelAndAwait () ,
210+ teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .Cancel ,
211211 onOutput : suspend (OutputT ) -> Unit = {},
212212 testTimeout : Long = WORKFLOW_TEST_DEFAULT_TIMEOUT_MS ,
213213 testCase : suspend WorkflowTurbine <RenderingT , OutputT >.() -> Unit
@@ -240,7 +240,7 @@ public fun <PropsT, OutputT, RenderingT> Workflow<PropsT, OutputT, RenderingT>.r
240240 testParams : WorkflowTestParams <Nothing > = WorkflowTestParams (),
241241 coroutineContext : CoroutineContext = StandardTestDispatcher (),
242242 interceptors : List <WorkflowInterceptor > = emptyList(),
243- teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .CancelAndAwait () ,
243+ teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .Cancel ,
244244 onOutput : suspend (OutputT ) -> Unit = {},
245245 testTimeout : Long = WORKFLOW_TEST_DEFAULT_TIMEOUT_MS ,
246246 testCase : suspend WorkflowTurbine <RenderingT , OutputT >.() -> Unit
@@ -264,7 +264,7 @@ public fun <OutputT, RenderingT> Workflow<Unit, OutputT, RenderingT>.renderForTe
264264 coroutineContext : CoroutineContext = StandardTestDispatcher (),
265265 testParams : WorkflowTestParams <Nothing > = WorkflowTestParams (),
266266 interceptors : List <WorkflowInterceptor > = emptyList(),
267- teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .CancelAndAwait () ,
267+ teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .Cancel ,
268268 onOutput : suspend (OutputT ) -> Unit = {},
269269 testTimeout : Long = WORKFLOW_TEST_DEFAULT_TIMEOUT_MS ,
270270 testCase : suspend WorkflowTurbine <RenderingT , OutputT >.() -> Unit
@@ -299,7 +299,7 @@ public fun <PropsT, StateT, OutputT, RenderingT>
299299 props : StateFlow <PropsT >,
300300 initialState : StateT ,
301301 coroutineContext : CoroutineContext = StandardTestDispatcher (),
302- teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .CancelAndAwait () ,
302+ teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .Cancel ,
303303 onOutput : suspend (OutputT ) -> Unit = {},
304304 testTimeout : Long = WORKFLOW_TEST_DEFAULT_TIMEOUT_MS ,
305305 testCase : suspend WorkflowTurbine <RenderingT , OutputT >.() -> Unit
@@ -329,7 +329,7 @@ public fun <StateT, OutputT, RenderingT>
329329 StatefulWorkflow <Unit , StateT , OutputT , RenderingT >.renderForTestFromStateWith (
330330 initialState : StateT ,
331331 coroutineContext : CoroutineContext = StandardTestDispatcher (),
332- teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .CancelAndAwait () ,
332+ teardown : WorkflowRuntimeTeardown = WorkflowRuntimeTeardown .Cancel ,
333333 onOutput : suspend (OutputT ) -> Unit = {},
334334 testTimeout : Long = WORKFLOW_TEST_DEFAULT_TIMEOUT_MS ,
335335 testCase : suspend WorkflowTurbine <RenderingT , OutputT >.() -> Unit
0 commit comments