Open hborham opened 2 years ago
Thanks for this!
@mefellows would you happen to know if this feature request is a candidate for https://github.com/pact-foundation/pact-js/labels/good%20first%20issue
It would make my life easier, so I was wondering if I could tackle this feature.
I don't think it is Haz, as this will require a framework-wide change. @uglyog @bethesque any thoughts on this?
Should this migrate to the Pact Spec project?
This is a pact-spec change.
Checklist
This checklist is optional, but studies show that people who have followed it checklist are really excellent people and we like them 🤣
Before making a feature request, I have:
Feature description
Please describe what you would like Pact-js to do
Extended support for matching arrays with an optional example parameter, such as:
Use case
What is the use case that motivates this feature request? Reuse of pacts for consumer development/testing while utilizing the pact-stub-server Please describe why you would like Pact-js to have this feature.
We have a consumer (react ui) pact we would like to reuse as a stub response within a real network request by loading our pacts into the
pactfoundation/pact-stub-server
. This benefits us in two specific ways:Our goal is to generate a realistic response to reuse during development/testing and also be minimalistic for the provider to verify, eg atLeastOneLike.
Request for matcher(s) to support
eachLike(matcher, exampleArray?), atLeastOneLike(matcher, exampleArray?)
so that the generated stub response for the consumer definition is:and the generated matcher for the provider is:
Additional discussion here pact-foundation.slack.com/#general