class assert.AssertionError
extends Error
Indicates the failure of an assertion. All errors thrown by the node:assert
module will be instances of the AssertionError
class.
Constructors Jump to heading
new
Jump to headingAssertionError(options?: { message?: string | undefined; actual?: unknown | undefined; expected?: unknown | undefined; operator?: string | undefined; stackStartFn?: Function | undefined; })
Properties Jump to heading
Jump to headingactual: unknown
Set to the actual
argument for methods such as assert.strictEqual().
Jump to headingcode: "ERR_ASSERTION"
Value is always ERR_ASSERTION
to show that the error is an assertion error.
Jump to headingexpected: unknown
Set to the expected
argument for methods such as assert.strictEqual().
Jump to headinggeneratedMessage: boolean
Indicates if the message was auto-generated (true
) or not.
Jump to headingoperator: string
Set to the passed in operator value.