Search code examples
postmanpostman-testcase

How to expect an test fail if I have a test case not implemented in Postman?


I'm writing API testing using Postman. I plan to write a failed test when I'm not implement the API yet.

I'm writing this at this moment.

pm.test("Not implement yet", function () {
    pm.expect(true).to.eql(false);
});

Is there something like this in Postman? I just want a test to be fail.

pm.test("Not implement yet", function () {
    pm.expect().fail();
});

Solution

  • You can use pm.expect.fail('This failed because ...');