Class AssertionError

Indicates the failure of an assertion. All errors thrown by the assert module will be instances of the AssertionError class.

Hierarchy

  • Error
    • AssertionError

Constructors

  • Parameters

    • Optional options: { actual?: unknown; expected?: unknown; message?: string; operator?: string; stackStartFn?: Function }
      • Optional actual?: unknown

        The actual property on the error instance.

      • Optional expected?: unknown

        The expected property on the error instance.

      • Optional message?: string

        If provided, the error message is set to this value.

      • Optional operator?: string

        The operator property on the error instance.

      • Optional stackStartFn?: Function

        If provided, the generated stack trace omits frames before this function.

    Returns "assert".AssertionError

Properties

actual: unknown
code: "ERR_ASSERTION"
expected: unknown
generatedMessage: boolean
operator: string

Generated using TypeDoc