Siddharth Gupta
08/29/2022, 9:57 AMMatt (pactflow.io / pact-js / pact-go)
Slackbot
08/29/2022, 10:07 AMMatt (pactflow.io / pact-js / pact-go)
Siddharth Gupta
08/29/2022, 10:14 AMSiddharth Gupta
08/29/2022, 10:30 AMSiddharth Gupta
08/29/2022, 10:30 AMSiddharth Gupta
08/29/2022, 10:31 AMMatt (pactflow.io / pact-js / pact-go)
arrayContaining
matcherTimothy Jones
08/30/2022, 12:28 AMarrayContaining
is where you want to treat an array as an unordered set.Timothy Jones
08/30/2022, 12:30 AMeachLike(X or Y)
is that the array [X,X]
or [Y,Y]
would both pass the test. Usually you want to be explicit - and expect exactly [X, Y]
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
arrayContaining
feature says “you can send me a bunch of objects, but I only care about X and Y shaped ones”. When the verification runs, the provider can return a bunch of objects, but must have at least X and Y in it, with the appropriate matching rules.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
The reason you can’t sayOn this, I was thinking last night that theoretically we could cover this situation. Currently, each interaction is stateless as far as the framework is concerned (sort of). But could we not wait until the end of the test run and say “wait, you only covered theis that the arrayeachLike(X or Y)
or[X,X]
would both pass the test. Usually you want to be explicit - and expect exactly[Y,Y]
[X, Y]
X
scenario but haven’t covered the Y
one - we’re not confident your code can do that” type thing?
It’s a departure from the model, but I think would allow for this and the other optional field problem to be solvedSiddharth Gupta
08/30/2022, 4:08 AMSiddharth Gupta
08/30/2022, 4:08 AMSiddharth Gupta
08/30/2022, 4:28 AMSiddharth Gupta
08/30/2022, 4:29 AMTimothy Jones
08/30/2022, 4:41 AMTimothy Jones
08/30/2022, 4:41 AMSiddharth Gupta
08/30/2022, 4:45 AM