hello, I have dumb question, is there a way to ign...
# pact-js
i
hello, I have dumb question, is there a way to ignore specific objects during provider verification or a matching for an array that ignores whatever is inside and just verify that there's an array (I might have misunderstood something in the documentation). Here's a snippet of a sample response... the first question, I wanted to ignore
ignoreMe
from verification if possible. If there's none, the second question of matching, the data in object
ignoreMe
are generated based on what's available data. TIA for answering the question of a QA :D
m
Yes, if you want to ignore them, don’t put them in the expectation
i.e. if you ask for
[{...}]
then you’re telling pact the things inside the array is important. If you just want to know it’s an array , then
[]
should do.
BUT, you probably don’t want to do that. I’m assuming you do care what’s inside them?
The point of Pact is to only mock the parts of the data you need, and not all of the possible data. By doing this, you communicate to the provider what they actually need to do, to do their job. By asking for everything, they now don’t know what you actually need and they can’t remove fields / endpoints that aren’t actually in use
i
thank you @Matt (pactflow.io / pact-js / pact-go) thankyou sorry for the late reply. the array inside is generated from another microservice so I was thinking of handling it on another test rather but you are right, we have to check this as well. Thank you 🙏
👍 1