-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
eachKeyLike() creates wrong matchingRules #1077
Comments
debug.log |
👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (PACT-1138). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps. |
Fixed in #1103 and pact-foundation/pact-js-core#462. Latest release in the core going out shortly, which is a transitive dependency that will get pulled in with new installs/updates. |
Software versions
Please provide at least OS and version of pact-js
Issue Checklist
Please confirm the following:
Expected behaviour
Given this interaction:
I would expect matchingRules in the resulting pact-file for the body that look like this:
Similar to the result from
eachLike()
used in the example for optionArray:Actual behaviour
Note:
$.options.*.*
with the accumulated matchers for all the fields.Nesting of eachKeyLike() works and results in more paths with
*
. in combination witheachLike()
down the body I get paths like this$.options.*.*.*[*].*[*].*.*.*
and all the paths contain just contain all the matchers for the respective fields together.Here is a excerpt from a more complex example:
Together with
"combine": "AND",
there is no way this will ever properly match.I think it's related to this issue here: pact-foundation/pact-reference#216 but I lack the necessary Rust Knowhow to dive into that.
Steps to reproduce
I forked the jest-pact Repository and adapted the v3 test to show the issue. I also added the resulting pact-file for easier reference here:
Repo: https://github.com/eburi/jest-pact
=>
npm install && npm run test
https://github.com/eburi/jest-pact/blob/master/src/v3/pactwith.v3.test.ts#L18
Resulting Pact File:
https://github.com/eburi/jest-pact/blob/master/pact/pacts/MyConsumer-pactWith%20v3.json
Relevant log files
debug.log
The text was updated successfully, but these errors were encountered: