Skip to content

//workflow/com.squareup.workflow1.testing/WorkflowTestParams

WorkflowTestParams

[jvm] @TestOnly()

class WorkflowTestParamsStateT>(startFrom: WorkflowTestParams.StartMode<StateT>, checkRenderIdempotence: Boolean)

Defines configuration for workflow testing infrastructure such as testRender, testFromStart. and test.

Parameters

jvm

startFrom

How to start the workflow – see StartMode.

checkRenderIdempotence

If true, every render method will be called multiple times, to help suss out any side effects that a render method is trying to perform. This parameter defaults to true since the workflow contract is that render will be called an arbitrary number of times for any given state, so performing side effects in render will almost always result in bugs. It is recommended to leave this on, but if you need to debug a test and don’t want to have to deal with the extra passes, you can temporarily set it to false.

Constructors

WorkflowTestParams [jvm] fun StateT> WorkflowTestParams(startFrom: WorkflowTestParams.StartMode<StateT> = StartFresh, checkRenderIdempotence: Boolean = true)How to start the workflow – see StartMode.

Types

Name Summary
StartMode [jvm]
Content
sealed class StartModeStateT>
More info
Defines how to start the workflow for tests.


Properties

Name Summary
checkRenderIdempotence [jvm] val checkRenderIdempotence: Boolean = trueIf true, every render method will be called multiple times, to help suss out any side effects that a render method is trying to perform.
startFrom [jvm] val startFrom: WorkflowTestParams.StartMode<StateT>How to start the workflow – see StartMode.