Hi,
I have a use case where from my workflow (MyWorkFlow), I execute a child workflow in another service.
Now, I am writing a unit test for MyWorkFlow and have to mock this child workflow. I am not sure how to register this workflow in the test env. This is what I tried-
Register workflow with test workflow environment
s.env.RegisterWorkflow(“ChildWFInAnotherService”)
Mock the response
s.env.OnWorkflow(“ChildWFInAnotherService”, mock.Anything).Return(mockResponse).
This throws an error on Register - test panicked: expected a func as input but was string
I think I need to give the child workflow name as a function reference, but not sure how if its on another service. Any suggestions?
Thanks for you reply @antonio.perez .
If you see my example, this is what I tried. But since the child workflow belongs to a different service, and hence not in this repository, it doesn’t recognize it.
In the sample code, the child workflow code is available.