You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created this project to show my problem a bit more interactive.
I have an endpoint that returns a object containing a list of objects. I do not want to compare the actual values of my pact, I just want to match the type.
Unfortunately it actually matches not only the size of the example list, but also the value of the fields.
Both of which is not wanted.
As the single return works fine I assume it has something to do with the .eachLike("myData", 2).
Any idea what I am doing wrong and how I can change it to get my desired outcome?
I already tried to ask in the Pact Slack workspace and Stackoverflow, but as there is no answer about what I should do differently, I assume it is a bug in the system.
Expected behaviour
generates test data: {"myData:[{"foo":"foo", "bar":"bar"}, {"foo":"foo", "bar":"bar"}]}
generates a pact that matches any size and any items for having a string field 'foo' and a string fiels 'bar'
Actual behaviour
generates test data: {"myData:[{"foo":"foo", "bar":"bar"}, {"foo":"foo", "bar":"bar"}]} ✔️
generates a pact that matches against {"myData:[{"foo":"foo", "bar":"bar"}, {"foo":"foo", "bar":"bar"}]} ❌
This behaviour I would expect when using stringValue
The text was updated successfully, but these errors were encountered:
huehnerlady
changed the title
Allow to match array with types only
Allow to match array content only by type
Oct 22, 2024
huehnerlady
changed the title
Allow to match array content only by type
[BUG] Allow to match array content only by type
Oct 22, 2024
I created this project to show my problem a bit more interactive.
I have an endpoint that returns a object containing a list of objects. I do not want to compare the actual values of my pact, I just want to match the type.
My Pact looks like this:
Unfortunately it actually matches not only the size of the example list, but also the value of the fields.
Both of which is not wanted.
As the single return works fine I assume it has something to do with the .eachLike("myData", 2).
Any idea what I am doing wrong and how I can change it to get my desired outcome?
I already tried to ask in the Pact Slack workspace and Stackoverflow, but as there is no answer about what I should do differently, I assume it is a bug in the system.
Expected behaviour
{"myData:[{"foo":"foo", "bar":"bar"}, {"foo":"foo", "bar":"bar"}]}
Actual behaviour
{"myData:[{"foo":"foo", "bar":"bar"}, {"foo":"foo", "bar":"bar"}]}
✔️{"myData:[{"foo":"foo", "bar":"bar"}, {"foo":"foo", "bar":"bar"}]}
❌This behaviour I would expect when using
stringValue
The text was updated successfully, but these errors were encountered: