Check for a specific array in response body?

I’m getting a response that has 2 arrays in it. Example:
{
“hobbies”: [
“skating”,
“painting”
],
“books”: [
“book1”,
“book2”
]
}

How to check that response doesn’t have array with the name “books”?

Thank you.

Hi @artradz.v,

Here is the test code to check that the response body does not have the array name books.

let response = pm.response.json();

pm.test(“Check that body had list”, function(){
pm.expect(response).to.not.have.property(‘books’);
});