Throws

Throws

Throws A test that expects a function to throw an exception. You may optionally provide a predicate to verify the thrown error. Inherits from ThrowsBase.

Constructor

new Throws(testName, fn, checkErrorFnopt, thisArgopt)

Description:
  • Tests that a function throws, and optionally that the thrown error satisfies a condition.
Source:
Parameters:
Name Type Attributes Description
testName string Name of the test.
fn function The function that should throw.
checkErrorFn function <optional>
Optional error predicate.
thisArg any <optional>
Optional `this` context.

Classes

Throws