Skip to content

Instantly share code, notes, and snippets.

@dnno
Last active May 24, 2022 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnno/a992d9fbc28ac410cb37c49603971b41 to your computer and use it in GitHub Desktop.
Save dnno/a992d9fbc28ac410cb37c49603971b41 to your computer and use it in GitHub Desktop.
Postman response test
let jsonData = JSON.parse(responseBody)
pm.test("Cars have been received", () => {
pm.response.to.have.status(200)
pm.expect(jsonData).to.not.be.undefined
pm.expect(jsonData).to.be.an('array')
pm.expect(jsonData).to.not.be.empty
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment