pact-ruby
pact-ruby copied to clipboard
Wildcard use with matchingRules
Hi,
I've got an EmberJS app which generates pacts. Let's say we fetch a list of articles each one with a title we do not want to verify explicitely. The (truncated) generated pact is :
"matchingRules": {
"$.body.data[*].attributes.title": {
"match": "type"
}
},
When I verify
with pact-ruby (v1.41.2
) it seems not to understand the directive as I have the following errors :
* Expected "enim dolores nihil" but got "some text" at $.data[0].attributes.title
* Expected "quasi cupiditate temporibus" but got "some text" at $.data[1].attributes.title
* Expected "repellendus doloribus quis" but got "some text" at $.data[2].attributes.title
* Expected "asperiores non labore" but got "some text" at $.data[3].attributes.title
* Expected "quae quas consequuntur" but got "some text" at $.data[4].attributes.title
What did I miss ?
Can you provide some executable code to recreate the issue please @afriqs. You can fork the pact-js repo and modify one of these to get something working quickly https://github.com/pact-foundation/pact-js/tree/master/examples
difficult to diagnose without the full pact or a repro, closing due to lack of activity