assertFails

@JvmName(name = "assertFailsInline")
inline fun assertFails(block: () -> Unit): Throwable(source)

Asserts that given function block fails by throwing an exception.

Since Kotlin

1.0

Return

An exception that was expected to be thrown and was successfully caught. The returned exception can be inspected further, for example by asserting its property values.