Expect.toThrow

Calls received and catches any exceptions thrown by it. Succeeds if it catches TExpected or a sub-type. Throws a FailingExpectationError otherwise.

There are three possible outcomes:

- received throws a TExpected or one of its sub-types. The expectation passes.

- received doesn't throw a TExpected, but does throw something else. A FailingExpectationError is thrown.

- received doesn't throw anything. A FailingExpectationError is thrown.

struct Expect(TReceived)
void
toThrow
(
TExpected : Throwable = Throwable
)
()
if (
isCallable!TReceived
)

Meta