Thanks @kclausing , that really helped me too!
The one thing I noticed, however, is that if you have other tests in the same request, they will still be executed. In my case, I added the setNextRequest(null)
and setNextRequest()
in both, so while the first test failed, the second passed and allowed the collection to continue.
My solution so far has been to add a bool
flag, and setting it to false
whenever we call setNextRequest(null)
, and to true
when calling setNextRequest()
. Then we add pm.expect(my_bool).to.be.true
at the beginning of each additional test, so they can fail and return immediately.