Hi team, we trying to run verifier for our provide...
# pact-js
t
Hi team, we trying to run verifier for our provider. However we want to break each interaction/state of the provider into separate test files. Currently, it looks like each test is overwriting the previous one, cause only the last test to verify one interaction.
m
Yes, at the moment that’s the cases. You could split the state handlers across multiple tests, but not the individual interactions. What’s the aim Tony?
m
so, it’s possible to have multiple contracts, for instance, if my app has 3 modules (accounts, reports, contacts) can I have 1 contract per module? and multiple consumer/provider files? or in real life, it doesn’t work like that
m
A contract is between a single consumer and a single provider. If the provider has 3 modules in it, that would usually be detail within the contract. You could model it that a provider is 3 applications, but it complicates your CI/CD pipeline and I wouldn’t advise it
what are you trying to achieve by splitting it?
m
you are right, what I was thinking is that having a huge file with many tests can be hard to read or maintain. I’m still learning about contract tests, so that’s what I was asking about best practices
🙏 1