Can someone please let me know that for a design f...
# pact-js
s
Can someone please let me know that for a design first development approach, is the unit tests only place where we can define our contracts?
m
If you’re using Pact to do this, that’s correct
👍 1
Pact is a code-first API testing tool. If you try to do it another way (e.g. automate the consumer side) it will be quite difficult to manage on the provider side
Pactflow has a process that might work for your design first approach: https://docs.pactflow.io/docs/bi-directional-contract-testing/
❤️ 1
s
@Matt (pactflow.io / pact-js / pact-go) How can we say Pact to be a code-first API tool, if we have to have the interactions known between the C and P, before we can add them to unit tests and generate a pact out of it? We do need designs between the two parties before hand right? Or am I missing something here?
m
It’s code first in that the tests are written in code, not in a spec/design first methodology (e.g. authoring an OAS or GraphQL schema before code is written)
We do need designs between the two parties before hand right?
No, you can definitely write the consumer code and it’s expectations of a provider, without ever having “designed” the API. Usually, we’d expect a conversation before code is written, but we don’t need an OAS or other design (if that’s what you mean)