i am trying to compare two json responses using deep.equals(). But its just comparing level-1 properties alone. Child properties are not being compared. Even though there are difference in child properties test passed.
Response-1:
{ "context": {
"property-1": {
"testProp": false,
"testProp2": null,
},
"notes": null,
},
"FirstName": "Name-1",
"id":"value-1",
"createdValues":{
"createTime":1234567,
"updateTime":2345677
}
}
Response-2
{
"context": {
"property-1": {
"testProp": false,
"testProp2": null,
},
"notes": null,
},
"firstName": "Name-2",
"id":"value-2",
"createdValues":{
"createTime":456778,
"updateTime":2345677
}
}
var ignoreFields=[“id”];
pm.test(“Validate response”, pm.expect(response1).to.not.include(ignoreFields).to.deep.equals(newResponse));
above statement comparing only “id” even though there is difference in other properties(createTime) test passed successfully. Is there anything needs to be added or anything i am missing