# Tests are incorrectly failing and passing!

**URL:** <https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [February 7, 2019, 4:44pm UTC](https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066 "2019-02-07T16:44:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emmaDF](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@emmaDF](https://community.postman.com/u/emmaDF)\
**Post date:** [February 7, 2019, 4:44pm UTC](https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066/1 "2019-02-07T16:44:28Z")

</div>

Hey,  
I’ve just added a heap of assertions into my requests, and for the most part they are working great.

I had one I miswrote, so was correctly failing, so I corrected it, but it’s still failing.  
So, just to check - I typed something into a passing test that should have caused it to fail, but it’s still passing.

Is there something I’m missing? Are the results getting stuck in a cache or something? I’ve tried closing/reopening etc, nothing seems to be bringing up the correct results.

The test:

tests [“price is correct”] = JSONdata.data[quoteNumber].price.total === 1100;

The reponse:

```
        "price": {
            "total": 1100
        },

```

Any ideas?

---

<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:** [February 7, 2019, 6:23pm UTC](https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066/2 "2019-02-07T18:23:13Z")

</div>

Have you tried the same test written with the `pm.test()` syntax?

---

<div class="post-metadata">

**Author:** ![tmccann](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tmccann/32/3550_2.png) [@tmccann](https://community.postman.com/u/tmccann)\
**Post date:** [February 7, 2019, 6:48pm UTC](https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066/3 "2019-02-07T18:48:50Z")

</div>

I have seen some of our QE’s come to me with results like this and like @danny-dainton suggested. Updating to the new syntax seems to have resolved many of those issues.

---

<div class="post-metadata">

**Author:** ![emmaDF](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@emmaDF](https://community.postman.com/u/emmaDF)\
**Post date:** [February 8, 2019, 10:48am UTC](https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066/4 "2019-02-08T10:48:12Z")

</div>

That worked! 😃 Which is obviously awesome, but now I have the problem of updating 800 odd tests to the new syntax! Damn. Will only make the mistake once though, I suppose. Need to learn to not listen to out of date tutorials!

---

<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:** [February 8, 2019, 12:46pm UTC](https://community.postman.com/t/tests-are-incorrectly-failing-and-passing/4066/5 "2019-02-08T12:46:37Z")

</div>

Maybe that gives you a chance to assess the whole collection and trim the checks that might not be still giving you the value they once did?

I would also recommend looking at using the collection and folder level tests, to avoid any unnecessary replication of the same test within each individual request.
