I’m starting to write tests for some of my Postman queries. I want to test whether the response to a query is JSON. It seems there are several ways to test for that. I could test the Content-Type and the response body, etc. However, I saw this test is available and I thought it would save some time coding tests:
pm.response.to.be.json;
But this test passes even when Content-Type is not “application/json” or when the body doesn’t contain valid JSON.
What is that test actually checking?
Also, where do I find thorough documentation of the available test functions?