Hello. The typical ‘happy path’ response from my API has this structure:
{
"features": [
{
"reportId": "RPT088308"
}
],
"success": true,
"error": null
}
When i test the value of “success” within a single response, tests of ‘true’ and ‘false’ both pass. I would expect one to pass and one to fail. In the test suite below, all three tests pass
pm.test("Content-Type header is application/json", () => {
pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json; charset=utf-8');
});
const jsonData = pm.response.json();
pm.test("json 'success' to be false"), () => {
pm.expect(jsonData.success).to.eql(false);
}
pm.test("json 'success' to be true"), () => {
pm.expect(jsonData.success).to.eql(true);
}
Am in misunderstanding what i think i’m testing? what could be amiss here?