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

48 Views Asked by At

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();
});
1

There are 1 best solutions below

1
Christian Baumann On BEST ANSWER

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