Home > Blockchain >  How to add Postman test asset error or success message
How to add Postman test asset error or success message

Time:01-12

In the postman I have following test. How to give assertion success or error message. I don't want to give message as console.log("my msg"). Coz console message goes to the console.I want to show the message as in the picture where postman shows pass or fail.

pm.test("Full version number present in response headers optional", () => {
let apiVersion = pm.response.headers.get("API-Version")
pm.expect(apiVersion).match(/[-.0-9] /)
})

enter image description here

CodePudding user response:

Official documentation in enter image description here

  • Related