https://pact.io logo
#pact-jvm
Title
# pact-jvm
h

Harihara Raj LK

03/05/2022, 1:22 PM
Hi people, Is it possible to do pact testing with the use of pact files available on local if pact broker is not reachable or accessible or based on some configuration?
m

Matt (pactflow.io / pact-js / pact-go)

03/06/2022, 9:05 AM
Yes, but how would you know if you're validating the correct pact?
Any logic in the broker would be hard to replicate locally, so just keep it in mind
You can verify files locally, on an http server or via a pact broker
h

Harihara Raj LK

03/07/2022, 5:24 AM
@Matt (pactflow.io / pact-js / pact-go) it is of the case when pact broker is not available for the local development environment ,but for the upper environments we have that pact broker setup. Is there any kind of configuration or switch to toggle between pact files or with pact broker setup, so that the build doesn't fail in case of any pact broker unavailability
m

Matt (pactflow.io / pact-js / pact-go)

03/07/2022, 6:00 AM
Yes, there are annotations to read from a local pact file vs a broker
I’m not sure what you mean by “local” vs “upper”. You should have a single pact broker for all environments, that’s how it’s supposed to be used