# How to set a tests to fail (false) with the new pm-api

**URL:** <https://community.postman.com/t/how-to-set-a-tests-to-fail-false-with-the-new-pm-api/978>\
**Category:** Help Hub\
**Created:** [February 19, 2018, 6:58am UTC](https://community.postman.com/t/how-to-set-a-tests-to-fail-false-with-the-new-pm-api/978 "2018-02-19T06:58:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tosh](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tosh](https://community.postman.com/u/tosh)\
**Post date:** [February 19, 2018, 6:58am UTC](https://community.postman.com/t/how-to-set-a-tests-to-fail-false-with-the-new-pm-api/978/1 "2018-02-19T06:58:51Z")

</div>

Hi,

Are we able to set a test to fail/false with the new pm-api?  
With the old-structure, we were able to write something like, to put a test-response to failed.

tests["Errormessage: " + json.message] = false;

How can i set this test to a failed one, i.e:

```
pm.test('This test will fail:', () => {
    

});
```

---

<div class="post-metadata">

**Author:** ![kamalaknn](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kamalaknn/32/93_2.png) [@kamalaknn](https://community.postman.com/u/kamalaknn)\
**Post date:** [February 20, 2018, 10:57am UTC](https://community.postman.com/t/how-to-set-a-tests-to-fail-false-with-the-new-pm-api/978/2 "2018-02-20T10:57:06Z")

</div>

The `pm.expect` is an extended assertion API built on `chaijs`. You can use `pm.expect.fail()` to set a test to always pass. Check out the official chai documentation - [http://chaijs.com/api/bdd/#method\_fail](http://chaijs.com/api/bdd/#method_fail).

---

<div class="post-metadata">

**Author:** ![tosh](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tosh](https://community.postman.com/u/tosh)\
**Post date:** [February 20, 2018, 4:44pm UTC](https://community.postman.com/t/how-to-set-a-tests-to-fail-false-with-the-new-pm-api/978/3 "2018-02-20T16:44:24Z")

</div>

Thanks!  
I came down to use assert.fail();
