Arnon Ram
07/13/2023, 1:05 PMPact::UnexpectedIndex
and
* Actual array is too long and should not contain a Hash at $.identity_locations[1]Timothy Jones
07/13/2023, 1:08 PMTimothy Jones
07/13/2023, 1:08 PMTimothy Jones
07/13/2023, 1:09 PMTimothy Jones
07/13/2023, 1:09 PMTimothy Jones
07/13/2023, 1:09 PMArnon Ram
07/13/2023, 1:11 PM.willRespondWith({
status: 200,
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
body: {
identity_locations: eachLike({
id: '123',
name: 'xxx',
}),
},
});Arnon Ram
07/13/2023, 1:14 PMTimothy Jones
07/13/2023, 1:15 PMArnon Ram
07/13/2023, 1:16 PMTimothy Jones
07/13/2023, 1:17 PMTimothy Jones
07/13/2023, 1:17 PMArnon Ram
07/13/2023, 1:18 PMTimothy Jones
07/13/2023, 1:18 PMTimothy Jones
07/13/2023, 1:18 PMTimothy Jones
07/13/2023, 1:19 PMArnon Ram
07/13/2023, 1:19 PMTimothy Jones
07/13/2023, 1:21 PMTimothy Jones
07/13/2023, 1:23 PMThe error message is saying that it wasn’t expected to contain two.This is the key point. Either your provider is returning two when it is supposed to return one, or the expectation in the contract is expecting one, when it is supposed to be expecting one or more.
Timothy Jones
07/13/2023, 1:23 PMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
07/13/2023, 1:40 PMTimothy Jones
07/13/2023, 1:41 PMTimothy Jones
07/13/2023, 1:41 PM