0

response

{
   user: {
          id: 1000
    }

I can make an assertion on the user key

pm.expect(response).to.have.key("user")

How do I make an assertion that id is there?

I tried this and it doesn't work:

pm.expect(response.user).to.have.key("user")
bezzoon
  • 1,755
  • 4
  • 24
  • 52

1 Answers1

0

Use this:

pm.expect(response.user).to.have.property('id')
Jeff Schaller
  • 2,352
  • 5
  • 23
  • 38
bezzoon
  • 1,755
  • 4
  • 24
  • 52