-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like to be able to utilise "like" and "eachLike" Matchers #191
Comments
I originally designed this tool to work with bi-directional contract testing whereby schema matching is done against the OAS from the pact example response and matchers are not required or used https://docs.pactflow.io/docs/bi-directional-contract-testing/tools/msw I would consider enhancements to the tool in order to support matchers, but I am unlikely to deliver it myself |
@stevenpollack have you made an attempt to add the matching functionality? |
Checklist
Before making a feature request, I have:
Feature description
Maybe the
verifyTest
method can take options likeresponseBody
(andrequestBody
), and these would contain mock data would passed along tolike
oreachLike
. E.g.So if I did something like
The resulting pact .json files could have appropriately rendered
matchingRules
properties. For instance, aresponse
property of a graphql interaction might look like:Use case
This is a very sensible thing to have when you're only interested in the shape of a response and not the exact values. For example, a service handling basic user information like
might not care about the exact
age
orcountry
of the test data, so long as they are numbers and strings. Making our test data flexible allows for (cosmetic) data refactoring without worry aboutcan-i-deploy
freaking out.Conversely, the adapter loses much of its potential utility if it creates pacts that are rigid in their assertions. Teams that require the use of
like
andeachLike
(for example) won't be inclined to use this adapter because they'll have to manually define interactions a lapact-js
.The text was updated successfully, but these errors were encountered: