# Skipping collection test but in the results it shows as skipped and failed

**URL:** <https://community.postman.com/t/skipping-collection-test-but-in-the-results-it-shows-as-skipped-and-failed/5438>\
**Category:** Help Hub\
**Tags:** tests, collections, skip\
**Created:** [May 15, 2019, 8:37am UTC](https://community.postman.com/t/skipping-collection-test-but-in-the-results-it-shows-as-skipped-and-failed/5438 "2019-05-15T08:37:39Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [May 15, 2019, 10:54am UTC](https://community.postman.com/t/skipping-collection-test-but-in-the-results-it-shows-as-skipped-and-failed/5438/6 "2019-05-15T10:54:41Z")

</div>

No worries. Always happy to help. 🏆

Another, simpler way (credit to @singhsivcan for this 🙂 ) of looking for the `status code` and skipping the tests would be this:

```javascript
    let skipTest = pm.response.code === 429;

    // Add this to the beginning of all the tests that need to be skipped when the status code is 429 
    // -> (skipTest ? pm.test.skip : pm.test)
    //
    // For eg:
    (skipTest ? pm.test.skip : pm.test)("Check status code", () => {
        pm.response.to.be.success
    });

```

This is just using a `local` variable to check if the response returns a `429 ` status code and is not using an `environment` variable, like a mentioned in the first reply. 🙂

---

_[View the full topic](https://community.postman.com/t/skipping-collection-test-but-in-the-results-it-shows-as-skipped-and-failed/5438)._
