I am currently using the following test in a collection, and can’t seem to figure out how to add an exception to this test.
pm.test("API response", function () {
pm.response.to.have.status(200);
pm.response.to.not.have.jsonBody("errors");
});
I would like to add an exception to this test- if a particular phrase (eg. “unique”) is included in the jsonBody, then I’d like to consider it as a Pass. This will not be present in the body of all the successful queries. Is this possible?
I appreciate any input!