I'm writing tests using Postman BDD / Chai and have ran in to an issue testing a response that is an array.
So my API returns something along the lines of
[
{
"id": 1,
"firstName": "x",
"lastName": "y",
"dateOfBirth": "2018-04-21",
"username": "user"
},
{
"id": 2,
"firstName": "x",
"lastName": "y",
"dateOfBirth": "2018-04-21",
"username": "admin"
}
]
How do I check that the response contains certain members?
expect(response).to.have.property('id');
Does not seem to function since the response is an array. Changing response to response[0] doesn't seem to change anything either.
Suggestions?


id?.mapetcpm.*functions?