Murat Ozcan
10/04/2024, 7:25 PMMatt (pactflow.io / pact-js / pact-go)
PACT_BREAKING_CHANGE to handle this. It won’t work for all scenarios (in your case, it assumes matching branches if I’m not mistaken) but the principle shows how it can be done 👏Matt (pactflow.io / pact-js / pact-go)
Murat Ozcan
10/05/2024, 11:33 AMMurat Ozcan
10/05/2024, 12:08 PMbuilder => builder.jsonBody({..}) is cumbersome
you might be able to make the api nicer by currying it like here
// Before
.willRespondWith(200, (builder) => builder.jsonBody({
id: integer(),
name: string(name),
year: integer(year)
}))
// After
.willRespondWith(200, setJsonBody({
id: integer(),
name: string(name),
year: integer(year)
}))
you might need to come up with something for the other builders like query builder
---------
another one
I use createProviderState everywhere , makes it fool-proof when passing parameters from the consumer to the provider
example
------
I use buildVerifierOptions everywhere, it cleans things up so much, example
I’m sure you can revise and improve them to accommodate a wider spectrum. I only solved the inconvenience for my ownMatt (pactflow.io / pact-js / pact-go)