Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(tb testing.TB, h *backplanetest.Harness) *testsuite.TestWorkflowEnvironment
New creates a Temporal test environment (go.temporal.io/sdk/ testsuite) set up as the service's worker is: every activity declared with activity.Handle or workflows.HandleActivity (by name, over the envelope), every workflow of workflows.Declare and workflows.Activity, and what workflows.Register registers. The service's hooks are a Nexus service of the environment answered by Answer, so workflows.CallHook works in workflow code; an unanswered hook fails with hook.ErrNoBinding, a failing answer with its message. Declare everything first; Start the harness first when the handlers use dependencies. An environment runs one workflow: call New again for the next.
w := workflowtest.New(t, h)
w.ExecuteWorkflow("Welcome", in)
err := w.GetWorkflowResult(&out)
func WorkflowActivity ¶
func WorkflowActivity[Req, Res any](w *testsuite.TestWorkflowEnvironment, name string, in Req) (Res, error)
WorkflowActivity runs the workflow-backed activity name (workflows.Activity) in w as a binding step would start it, and returns its result. w is from New; it runs this one workflow.
Types ¶
This section is empty.