isFailure

Asserts the given Result threw an exception, returning that exception if it was or failing it if didn't.

assertThat(runCatching { throw Exception("error") }).isFailure().hasMessage("error")