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

chore: expand ftltest fakes to other verb types #1415

Merged
merged 1 commit into from
May 7, 2024

Conversation

matt2e
Copy link
Collaborator

@matt2e matt2e commented May 6, 2024

  • added WhenSink(...), WhenSource(...), WhenEmpty(...) to ftltest
    • (Not particularly happy with the name of that last one)
  • integration tests: new module called verbtypes has its own tests which fakes out each type of verb with a happy case and an error case

@matt2e matt2e requested a review from a team as a code owner May 6, 2024 05:53
@matt2e matt2e requested review from wesbillman and removed request for a team May 6, 2024 05:53
@alecthomas alecthomas mentioned this pull request May 6, 2024
Comment on lines +17 to +30
ftltest.WhenVerb(Verb, func(ctx context.Context, req Request) (Response, error) {
return Response{Output: fmt.Sprintf("fake: %s", req.Input)}, nil
}),
ftltest.WhenSource(Source, func(ctx context.Context) (Response, error) {
return Response{Output: "fake"}, nil
}),
ftltest.WhenSink(Sink, func(ctx context.Context, req Request) error {
knockOnEffects["sink"] = req.Input
return nil
}),
ftltest.WhenEmpty(Empty, func(ctx context.Context) error {
knockOnEffects["empty"] = "test"
return nil
}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! This is great :)

@matt2e matt2e force-pushed the matt2e/when-source-sink-empty branch from 09c9830 to 8331bfd Compare May 7, 2024 00:39
@matt2e matt2e merged commit 26401ca into main May 7, 2024
10 checks passed
@matt2e matt2e deleted the matt2e/when-source-sink-empty branch May 7, 2024 00:42
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.

2 participants