CatchChecker type (joe.test)


A fluent test checker for catch() results. Use checkCatch(callable) to create it.

Initializer

Methods

CatchChecker Initializer


CatchChecker(catchResult) → CatchChecker

Initializes the checker with the result of a catch().

Methods


catchChecker.isError()


catchChecker.isError() → Boolean

Returns true if there was an error, and false otherwise.

catchChecker.isOK()


catchChecker.isOK() → this

Checks that the catch result is not an error.

catchChecker.message()


catchChecker.message(expected) → this

Checks that the error message matches the expected value.

catchChecker.stackFrames()


catchChecker.stackFrames(frame,...) → this

Checks that the actual stack frames match the expected list of stack frames. The expected frames are passed as individual arguments.

catchChecker.stackTrace()


catchChecker.stackTrace(expected) → this

Checks that the actual stack traces matches the expected stack trace string.

catchChecker.type()


catchChecker.type(expected) → this

Checks the error type matches the expected value.