@nevware21/tripwire - v0.1.2

    Interface ThrowFn

    The throw function signatures

    • Asserts that the current value is a function and when executed throws an error where the message matches the msgMatch string or regular expression.

      Parameters

      • OptionalmsgMatch: string | RegExp

        The message to match

      • OptionalevalMsg: MsgSource

        The message to display if the value does not throw an error

      Returns IAssertInst

      A new IAssertInst instance with the same value and context.

      An AssertionFailure error if the value is not a function

      An AssertionFailure error is not an error instance

      An AssertionFailure error if the value does not throw an error

      An AssertionFailure error if the message from the thrown error does not include the string identified in the msgMatch.

      An AssertionFailure error if the message from the thrown error does not match the regular expression passed in msgMatch.

    • Asserts that the current value throws an error which matches the errorLike type and optionally also matches the msgMatch message

      Parameters

      • OptionalerrorLike: Error | ErrorConstructor

        The error to match

      • OptionalmsgMatch: string | RegExp

        The message to match

      • OptionalevalMsg: MsgSource

        The message to display if the value does not throw an error

      Returns IAssertInst

      A new IAssertInst instance with the same value and context.

      An AssertionFailure error if the value is not a function

      An AssertionFailure error is not an error instance

      An AssertionFailure error if the error thrown does not match the errorLike constructor or type.

      An AssertionFailure error if the value does not throw an error

      An AssertionFailure error if the message from the thrown error does not include the string identified in the msgMatch.

      An AssertionFailure error if the message from the thrown error does not match the regular expression passed in msgMatch.

    MMNEPVFCICPMFPCPTTAAATR