Skip to content

SessionWorkflow throws when trying to unit test it with RenderTester#testRender #1138

@antoniorosario

Description

@antoniorosario

When trying to unit test a Workflow that inherits from SessionWorkflow using RenderTester#testRender I get this error:

SessionWorkflow should never call initialState without the CoroutineScope.
java.lang.IllegalStateException: SessionWorkflow should never call initialState without the CoroutineScope.
at com.squareup.workflow1.SessionWorkflow.initialState(SessionWorkflow.kt:82)
at com.squareup.workflow1.testing.RenderTesterKt.testRender(RenderTester.kt:29)

It looks like RenderTester#testRender is calling an overloaded initialState method that SessionWorkflow doesn't support, see

public final override fun initialState(
props: PropsT,
snapshot: Snapshot?
): StateT {
error("SessionWorkflow should never call initialState without the CoroutineScope.")
}
}
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions