Skip to content

//workflow/com.squareup.workflow1.testing/launchForTestingFromStateWith

launchForTestingFromStateWith

[jvm]
Content
@TestOnly()

fun <T, PropsT, StateT, OutputT, RenderingT> StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>.launchForTestingFromStateWith(props: PropsT, initialState: StateT, context: CoroutineContext = EmptyCoroutineContext, block: WorkflowTestRuntime<PropsT, OutputT, RenderingT>.() -> T): T
@TestOnly()

fun <StateT, OutputT, RenderingT> StatefulWorkflow<Unit, StateT, OutputT, RenderingT>.launchForTestingFromStateWith(initialState: StateT, context: CoroutineContext = EmptyCoroutineContext, block: WorkflowTestRuntime<Unit, OutputT, RenderingT>.() -> Unit)
More info

Creates a WorkflowTestRuntime to run this workflow for unit testing. If the workflow is stateful, initialState is not called. Instead, the workflow is started from the given initialState.

All workflow-related coroutines are cancelled when the block exits.