Hi
New to both Postman & JS. I am trying to check the values in a JSON response from an API. I expect some tests to fail as I am checking for a value that is not present but my tests are passing & I am not sure why?
The response JSON is structured as follows:-
{
"details": [
{
"number": "1234",
"type": "integer",
"name": "array"
}
]
}
The negative test I’ve written is as follows:-
pm.test("Type "), function () {
pm.expect(pm.response.json().details[0].type).to.eql("String");
};
I expected this to fail but it passed. I think it may be down to having an object within an array. Any help would be appreciated.