# How to test if property at least has something?

**URL:** <https://community.postman.com/t/how-to-test-if-property-at-least-has-something/21210>\
**Category:** Help Hub\
**Created:** [March 10, 2021, 10:00am UTC](https://community.postman.com/t/how-to-test-if-property-at-least-has-something/21210 "2021-03-10T10:00:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hfhInventio](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@hfhInventio](https://community.postman.com/u/hfhInventio)\
**Post date:** [March 10, 2021, 10:00am UTC](https://community.postman.com/t/how-to-test-if-property-at-least-has-something/21210/1 "2021-03-10T10:00:12Z")

</div>

Im writing tests and have to check that a property at least has some text. I dont care what the text is but that it at least has something in it. It cannot be empty. My json is converted from xml with xml2json component.

```
pm.expect(responseJson.commentlines.commentline).to.have.property('comment');
pm.expect(responseJson.commentlines.commentline.comment).to.eql('There is at least something here');
```

---

<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:** [March 10, 2021, 10:32am UTC](https://community.postman.com/t/how-to-test-if-property-at-least-has-something/21210/2 "2021-03-10T10:32:17Z")

</div>

Hey @hfhInventio 👋

For something basic, you _could_ use:

```auto
pm.test('Value is a string and not empty', () => {
    pm.expect(responseJson.commentlines.commentline.comment).to.be.a('string').and.not.be.empty
})

```

[https://www.chaijs.com/api/bdd/#method\_empty](https://www.chaijs.com/api/bdd/#method_empty)

---

<div class="post-metadata">

**Author:** ![hfhInventio](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@hfhInventio](https://community.postman.com/u/hfhInventio)\
**Post date:** [March 10, 2021, 10:58am UTC](https://community.postman.com/t/how-to-test-if-property-at-least-has-something/21210/3 "2021-03-10T10:58:00Z")

</div>

Works. This is exactly how I would like it to be.

Thank you very much
