Skip to main content
default.AssertionError - node__assert.d.ts - Node documentation
class default.AssertionError
extends Error

Usage in Deno

```typescript import mod from "node:node__assert.d.ts"; ```
Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class.

Constructors

new
AssertionError(options?: { message?: string | undefined; actual?: unknown | undefined; expected?: unknown | undefined; operator?: string | undefined; stackStartFn?: Function | undefined; })

Properties

actual: unknown
Set to the `actual` argument for methods such as assert.strictEqual().
code: "ERR_ASSERTION"
Value is always `ERR_ASSERTION` to show that the error is an assertion error.
expected: unknown
Set to the `expected` argument for methods such as assert.strictEqual().
Indicates if the message was auto-generated (`true`) or not.
operator: string
Set to the passed in operator value.