I would like to have tests where assumptions fail show up as aborted rather than failed. Is there any way to abort a test and have it show up as such? When working with Junit we would throw an
IncompleteExecutionException
or specialization there-of.. I assume, when using Junit platform, it would be fine to import those exceptions and throw them? Is there any more "kotest-native" way of doing this?
s
sam
08/25/2021, 1:57 AM
You want the test to be red rather than yellow?
e
Emil Kantis
08/25/2021, 11:03 AM
Hehe 🙂 Ideally shown as skipped, with a log message saying what assumption failed.. But I notice it does not happen when using
IncompleteExecutionException
either.
s
sam
08/25/2021, 11:46 AM
Can you show a screenshot of what you mean from junit
Tried to fake a good scenario for it but it felt really contrived.. but I would mostly use it when integration testing.
For instance if we want
given a user with permissions X should be able to do Y
, then creation and granting of permissions goes into an assumption block. If the assumptions fail, the test should show as aborted since the purpose of the test is to check that the user can do Y, not to test user creation or granting of permissions