<#1207 `eachLike` behaves like `atLeastOneLike` wh...
# pact-js-development
g
#1207 `eachLike` behaves like `atLeastOneLike` when min is not explicitly set - contrary to documentation Issue created by timvahlbrock Software versions Please provide at least OS and version of pact-js • OS: Win 11 • Consumer Pact library: 12.4.0 • Provider Pact library: irrelevant • Node Version: 21.6.0 Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme • [ x I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures ☐ I have set my log level to debug and attached a log file showing the complete request/response cycle (not possible due to GDPR on main project, can generate log using reproduction repro if required) ☐ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem Expected behaviour
eachLike
sets a
min
of 0 by default or the documentation is corrected. Actual behaviour
eachLike
sets a
min
of 1 by default. The documentation states that the length is not checked. Likely introduced in 974d247#diff-884c1c7cbdaafa772a7a428e0ca83ce1fc58f03972dfa0fabcb89106d6ac35f5 Steps to reproduce Use
eachLike
for an array property. Run pact consumer tests. See the property received a
min
of 1. Should look something like this:
Copy code
"$[*].theArrayProperty": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "type",
                  "min": 1
                }
              ]
            },
Relevant log files Please ensure you set logging to
DEBUG
and attach any relevant log files here (or link to a gist).
As described, I can add logs from a reproduction repo if desired, but I think this might not be required here. pact-foundation/pact-js