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

Feature Request: Any plans for Pact tests generator? #125

Open
MikeBenton2 opened this issue Sep 29, 2024 · 2 comments
Open

Feature Request: Any plans for Pact tests generator? #125

MikeBenton2 opened this issue Sep 29, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MikeBenton2
Copy link

Hey y'all, writing all these tests manually suuuuucks which I'm sure a lot of us can agree upon. Especially when you may have a lot of logic in one API call. Are there any plans for generating some of the boiler plate code from an openAPI Spec?

I also posted this request within the other iOS Pact framework: DiUS/pact-consumer-swift#130

@MikeBenton2 MikeBenton2 added the enhancement New feature or request label Sep 29, 2024
@surpher
Copy link
Owner

surpher commented Oct 4, 2024

That would be fantastic, indeed.

Personally I am not using PactSwift for my/clients' needs at all lately so am limited in expanding features in PactSwift or even just keeping up with pact-foundation's evolution.
I've got a backlog of cleanup tasks to do before diving back into improvements.

I'm curious though!
Have you had any thoughts about how this would work? I mean, what would developers' experience be?

There's a blog post out there where it describes how they've improved writing pact tests. Unfortunately they didn't make it open source.

Contributions are always welcome.

EDIT:
Opened PactFoundation's slack workspace now and found this announcement. Considering what's shared there there should be direction to follow.

@surpher surpher added the help wanted Extra attention is needed label Oct 8, 2024
@MikeBenton2
Copy link
Author

Read the blog post and I'm using Matcher to it's fullest. However, It would have been nice to match it to a Model of a certain type, rather than a literal string, int, bool, etc.
Eg.

struct MyModel {
var myInt: Int
var myString: String
}

Matcher.somethingLike(MyModel.Type)

The generation would be a little more tricky, but there's already the OpenAPI Code Generator that my team uses to generate our models and API's so a little inspiration could be taken there. I'm not sure exactly how it would work, but something to keep in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants