Harry
03/01/2023, 4:43 PMauthors: eachLike(['Harry', 'Garry', 'Reilly']),
and this is the provider's mock data against which its running the tests :-
"authors": ["Frances", "Gibbs"],
And I am getting the below error :-
1.2) body: $.featured.authors.0 Type mismatch: Expected List ["Harry","Federer","Rilos"] but received String 'Frances'
-[
- "Harry",
- "Federer",
- "Rilos"
-]
+"Frances"
1.3) body: $.featured.authors.1 Type mismatch: Expected List ["Harry","Federer","Rilos"] but received String 'Gibbs'
-[
- "Harry",
- "Federer",
- "Rilos"
-]
+"Gibbs"uglyog
eachLike takes a single example and ensures all items in the list match that example. So authors: eachLike('Harry'),Matt (pactflow.io / pact-js / pact-go)
eachLike otherwise you’re expecting an array of arraysHarry
03/02/2023, 7:58 AMHarry
03/02/2023, 10:10 AMMatt (pactflow.io / pact-js / pact-go)
authors: eachLike(['Harry', 'Garry', 'Reilly']),
do
authors: eachLike('Harry'),Matt (pactflow.io / pact-js / pact-go)
authors: [['Harry', 'Garry', 'Reilly']]
The second one matches a structure like this:
authors: ['Harry', 'Garry', 'Reilly']Matt (pactflow.io / pact-js / pact-go)
eachLike is used for a property, where each (implies an array) item in the array is like <sample>Matt (pactflow.io / pact-js / pact-go)
Harry
03/02/2023, 12:53 PMHarry
03/02/2023, 4:25 PMauthors: eachLike('Harry')
and got the following error :-
1.1) body: $.featured Actual map is missing the following keys: topic
{
"authors": [
- "Harry"
+ "Federer",
+ "Rilose"
],
any resolution for this please?Harry
03/02/2023, 4:26 PMMatt (pactflow.io / pact-js / pact-go)
trace level logs for this test?Harry
03/03/2023, 9:59 AM