I have a test set in a collection to check whether the status of the response is one of a list:
pm.test('Check status code', () => {
pm.expect(pm.response.code).to.be.oneOf([200, 201, 202, 203, 204, 205, 206, 207, 208, 226])
})
In the Pre-request script of two of my requests, I have a line to skip the test that is set up for this collection (as I know the response of these two particular tests is going to be different but that’s ok for these as individual requests).
pm.test.skip(‘Check status code’)
However, when I run the collection, the results show that the relevant tests have been skipped AND failed. How is this happening?
*Note - if I have the full skip instruction as this, it still skips and fails:
pm.test.skip('Check status code', () => {
pm.expect(pm.response.code).to.be.oneOf([200, 201, 202, 203, 204, 205, 206, 207, 208, 226])
})
Thank you in advance!