Just use a try {…} catch {…} pattern :
pm.test("your test(s)", function () {
try {
pm.expect(jsonData).to.be(…); // your test goes here
test_succeeded = true;
} catch (e) {
test_succeeded = false;
throw (e); // depending on wether you want to stop at the first failing test (default Postman behavior) or you want to perform all the tests, you may respectively add this line or remove it.
}
…
// repeat the try {…} catch {…} pattern for each one of your pm.expect() tests, if necessary
…
// If you removed the "throw (e)" above, your pm.test() will always succeed, which is probably not what you want...
// In this case, you'll need to uncomment the following line :
// pm.expect(test_succeeded, "at least one test failed").to.be.true;
}