Constructor
new ThrowsBase(testName, expectingError, fn, checkErrorFnopt, thisArgopt)
- Description:
- Base class to test whether a function throws (or not), and optionally validate the error thrown.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Name of the test. | |
expectingError |
boolean | Whether an error is expected (`true` = should throw). | |
fn |
function | Function to test. | |
checkErrorFn |
function |
<optional> |
Optional error predicate to validate the thrown error. |
thisArg |
any |
<optional> |
Optional `this` context for invoking the test/check function. |