At consumer level test is :
describe('Listing first level taxonomies', () => {
before(() => {
return provider.addInteraction({
given: 'GET call for first level taxonomies',
uponReceiving: 'Get object for listing first level
taxonomies',
withRequest: {
method: 'GET',
path: '/api/taxonomies/8061159/taxons?deleted=false',
},
willRespondWith: {
status: 200,
headers: { 'Content-Type': 'application/json' },
body: firstChild
}
});
});
const firstChild = eachLike({
'name': like('Geo'),
'taxons': [
eachLike({
'id': like(115590),
'name': like('Africa'),
'hasChildren':like (false)
})
]
});
When i verify at provider level , I am getting the error as: Expected an Array but got a Hash ({"name"=>"Demo Taxonomy", "taxons"=> [{"id"=>8145188, "name"=>"manojtaxon", "childCategoryName"=>"hello", "hasChildren"=>true} Full error is present at : https://pastebin.com/XvB17SXY
Please help me in resolving the issue What i think is array size is more at provider level thats why it is failing .Though i have added like and eachLike ( Still it has not resolved it ) .