thibault alix
10/26/2023, 6:22 PM{
"_internal": {
"entries": [
{
"data": {
"value": [
"A",
"B",
"C",
"D",
"E"
]
}
}
]
}
}
.willRespondWith(200, (builder) => {
builder
.jsonBody({
_internal: {
entries: [{
data: {
value: arrayContaining("A", "C", "D")
}
}]
}
})
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
thibault alix
10/26/2023, 9:59 PM"data": [
null,
null,
null
]
and in the matcher section:
"matchers": [
{
"match": "arrayContains",
"variants": [
{
"index": 0,
"rules": {}
},
{
"index": 1,
"rules": {}
},
{
"index": 2,
"rules": {}
}
]
}
the producer test is failing with:
...data -> Variant at index 0 (null) was not found in the actual list
...data -> Variant at index 1 (null) was not found in the actual list
...data -> Variant at index 2 (null) was not found in the actual list
Matt (pactflow.io / pact-js / pact-go)
arrayContaining
accepts an []
right?Matt (pactflow.io / pact-js / pact-go)
thibault alix
10/27/2023, 3:00 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
arrayContaining
is not an anti-pattern, but usually you can avoid it. You might be right in that it is too shape/type driven