Closed eburi closed 11 months ago
debug.log
Updates log-file as I added the optionArray
to show the difference in the result from eachKeyLike()
and eachLike()
Thanks @eburi. Just a note to say that there is a separate issue with eachKeyLike
- see #952 #662.
The fix for those might address this, but we'd need to chek.
👋 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.
See our documentation for more information.
Fixed in #1103 and https://github.com/pact-foundation/pact-js-core/pull/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: https://github.com/pact-foundation/pact-reference/issues/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