Hello everyone, we are currently (pre-pact) genera...
# pact-js
t
Hello everyone, we are currently (pre-pact) generating the consumer api code from the openapi spec provided by the provider. When using contract testing we would have to remove that, as this approach is provider driven. So I guess the api call would then just be back to calling fetch/axios manually, right? Most example projects do it like this, and I didn't find any larger open source projects using pact (/contract testing).
m
You can still generate client code from the OAS, that's orthogonal to contract testing
The point is that you can specify (via a test) the set of examples that matter to the client
t
But when adding new endpoints I will still need to update the OAS in the provider first, so I can use the new generated endpoint calls in my consumer contract tests and then return to the provider to implement contract verification there.
m
Yes, you don't have to though, it's entirely up to you. I'm just stating that those decisions are separate
I'm not a fan of generating clients in general, and pact probably is easier if you don't (because it obscures some if the details), but you can
t
Okay thanks. > Most example projects do it like this, and I didn't find any larger open source projects using pact (/contract testing). I actually found by coincidence yesterday, that Gitlab is using Pact: https://docs.gitlab.com/ee/development/testing_guide/contract/
🙌 1
m
No worries - and yeah, maybe we should get them on our site somewhere. I think we’ve tried reaching out in the past to learn more
👍 1