expectFailure

fun expectFailure(check: (Exception) -> Unit = {}): Exception

Checks that the run failed next, and passes what it threw to check: usually a NodeExecutionException, whose cause is what the node threw.

An AssertionError, such as the one of a scripted model whose script is too short, is not a failure of the run: it fails the test.

Return

what the run threw.