Search code examples
quick-nimble

Can I fast-fail a test series?


I have a set of tests that crash the whole test suite if a given situation arises. Moreover, that situation is already a failure for the suite.

Rather than crash, I'd rather test if the condition is true during the setup of the series, and fast-abort it with a failure.

Is that possible?


Solution

  • Yes, you can fail a test at anytime with:

    fail("And here you give the reason for the failure")