Skip to content
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

workflow: Allow passing API into testing utility functions #92

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

andrewwormald
Copy link
Collaborator

This allows for users to return a workflow.API from a function and still use the testing functions as long as the underlying type is a *workflow.Workflow and not, for instance, a mock implementation.

@andrewwormald andrewwormald marked this pull request as draft February 19, 2025 18:17
@andrewwormald
Copy link
Collaborator Author

Need to do some cleanup still

@andrewwormald andrewwormald marked this pull request as ready for review February 20, 2025 16:52
@andrewwormald andrewwormald merged commit 8294b24 into main Feb 21, 2025
7 checks passed
@@ -22,6 +22,11 @@ func TriggerCallbackOn[Type any, Status StatusType, Payload any](
panic("TriggerCallbackOn can only be used for testing")
}

w, ok := api.(*Workflow[Type, Status])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes my spidey sense tingle a little. Why can't waitFor accept an API[Type, Status]?

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 this pull request may close these issues.

3 participants