Skip to content

//workflow/com.squareup.workflow1.testing/launchForTestingWith

launchForTestingWith

[jvm]
Content
@TestOnly()

fun <T, PropsT, StateT, OutputT, RenderingT> StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>.launchForTestingWith(props: PropsT, testParams: WorkflowTestParams<StateT> = WorkflowTestParams(), context: CoroutineContext = EmptyCoroutineContext, block: WorkflowTestRuntime<PropsT, OutputT, RenderingT>.() -> T): T
More info

Creates a WorkflowTestRuntime to run this workflow for unit testing.

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