Options
All
  • Public
  • Public/Protected
  • All
Menu

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

constructor

  • Parameters

    • Optional options: object
      • 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 AssertionError

Properties

actual

actual: unknown

code

code: "ERR_ASSERTION"

expected

expected: unknown

generatedMessage

generatedMessage: boolean

message

message: string

name

name: string

operator

operator: string

Optional stack

stack: string

Static Optional prepareStackTrace

prepareStackTrace: function

Optional override for formatting stack traces

Type declaration

    • (err: Error, stackTraces: CallSite[]): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

Static stackTraceLimit

stackTraceLimit: number

Methods

Static captureStackTrace

  • captureStackTrace(targetObject: object, constructorOpt?: Function): void
  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc