Hey guys I had a question , pact is used to test t...
# general
a
Hey guys I had a question , pact is used to test the integration between 2 services or integration between UI and a service but is there any use case where we can use it to test one single API ? keeping the consumer and producer as the same API and testing different endpoints of that API , does it make sense or possible somehow ?
m
What exactly would you want Pact to do that other tools couldn’t do here?
e.g. a functional testing tool
👍 1
a
Yea like instead of testing the integration between 2 services could we test the different endpoints of a single service by keeping the consumer/producer as the same ? Currently what I’m aware of is pact is only or can only be used to test the integration between 2 services
m
test the different endpoints of a single service by keeping the consumer/producer as the same ?
I’m not sure what that would look like? If you only have a provider and no consumers, you could write a dummy client that exercises all of the endpoints and create a pact from it
a
you could write a dummy client that exercises all of the endpoints and create a pact from it
yep that’s what I’m thinking but writing the code that exercises all of the endpoints in our service and the code that verifies the pact in the same service as well . will that be possible or if the pact can be used like this can it serve as an alternative for functional testing of a service ?
m
you can definitely run pact in that way, yes
I wouldn’t see it’s an alternative to functional testing in a general sense, but yes, in that context it would be possible to exercise it in ways that would be more maintainable and extend beyond a purely contract testing tool
👍 1
a
that clears my doubt , thank you Matt 🙌
👍 1