Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
antoniorosario opened this issue Nov 17, 2023 · 0 comments · Fixed by #1141
Closed

Comments

@antoniorosario
Copy link

antoniorosario commented Nov 17, 2023

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.")
}
}
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant