Adds a breaking change for our consumer, by introducing a field that does not exist in our provider oas.
Caveats
This example shows adding a field, to a Cypress fixture file which is encoded into a Pact file at the end of the Cypress test.
As you can see from the pull request, the new field foo is not being used in the consumer code at all.
Be aware of this and ensure your mocks are in sync with your consumer code, so you only encode into the Pact file, fields that your consumer depends on.
This is where the beauty of contract testing lies, as you give a provider an up-to-date view of exactly the consumers requirements.
We could easily remove the version field, as that is not used in our consumer client code at all, and keeps our mocks lean.
Adds a breaking change for our consumer, by introducing a field that does not exist in our provider oas.
Caveats
This example shows adding a field, to a Cypress fixture file which is encoded into a Pact file at the end of the Cypress test.
As you can see from the pull request, the new field
foo
is not being used in the consumer code at all.Be aware of this and ensure your mocks are in sync with your consumer code, so you only encode into the Pact file, fields that your consumer depends on.
This is where the beauty of contract testing lies, as you give a provider an up-to-date view of exactly the consumers requirements.
We could easily remove the
version
field, as that is not used in our consumer client code at all, and keeps our mocks lean.