GitHub
07/14/2023, 8:00 AMeachLike doesn't match correctly. This object:
{
"john-doe1": {
"brown-fox": {
"jumps": "over",
"the": "lazy dog"
}
},
"john-doe2": {
"brown-fox2": {
"jumps": "over",
"the": "lazy dog"
}
}
}
should be matched by
Matchers.eachKeyLike(
"some string",
Matchers.eachKeyLike(
"some-string",
Matchers.eachKeyLike(
"some-string",
Matchers.string())))
Actual behaviour
It is not matched - the match only applies at the first level.
Steps to reproduce
As above
Extra information
To get the fix, we'll need to bump the rust core to at least 0.3.12.
Also, as @uglyog pointed out:
BTW, the eachKeyLike function is incorrectly named. It should be something like eachValueLike.Probably the right fix for this is: • Rename the existing
eachKeyLike to eachValueLike
• Add the eachKeyLike matcher (this is a breaking change, since the signature for eachKeyLike would describe something different to what it currently does / and currently is documented to do)
• Update the documentation to match
• For bonus points, I think there's also an eachKeyValueLike matcher which could be added
pact-foundation/pact-jsGitHub
07/14/2023, 8:00 AM