Hi there, Is there a best practice or strategy to ...
# general
s
Hi there, Is there a best practice or strategy to enable provider states given statements reusability for consumers instead of every consumer creating syntactically different statements but semantically mean the same. for e.g
user exists
,
user is present
,
user is available
etc.
m
There are some good tips in https://docs.pact.io/consumer
There are two schools of thought 1. Each consumer should have its own set of states (this was the actual view of the creator of the feature) 2. Try to re-use these states a. this is my preference, particularly with larger rollouts
🙌 1
How to reuse the states? 1. If a provider gets a contract for the first time, it can not implement the new states and request the consumer to align to one that already exists 2. You could create a “golden” set of states with a “golden” example consumer for your provider, and then ask consumers to cherry pick what they need from that
🙌 1
There are no doubt more ways to achieve this
s
Thanks @Matt (pactflow.io / pact-js / pact-go)
👍 1