throws | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function throws

    • Expect a call or promise to throw

      Parameters

      • expect: RegExp

        A regular expression to match the exception message against

      • func_or_promise: () => never

        A function to call, or a promise to await

      • Optionalannotation: Annotation

        Optional annotation to log if the test fails

      Returns Error

      The Error object thrown

    • Expect a call or promise to throw

      Parameters

      • expect: RegExp

        A regular expression to match the exception message against

      • func_or_promise: Promise<unknown>

        A function to call, or a promise to await

      • Optionalannotation: Annotation

        Optional annotation to log if the test fails

      Returns Promise<Error>

      The Error object thrown

    • Expect a call or promise to throw

      Parameters

      • expect: RegExp

        A regular expression to match the exception message against

      • func_or_promise: () => Promise<unknown>

        A function to call, or a promise to await

      • Optionalannotation: Annotation

        Optional annotation to log if the test fails

      Returns Promise<Error>

      The Error object thrown

    • Expect a call or promise to throw

      Parameters

      • expect: RegExp

        A regular expression to match the exception message against

      • func_or_promise: () => unknown

        A function to call, or a promise to await

      • Optionalannotation: Annotation

        Optional annotation to log if the test fails

      Returns Error

      The Error object thrown