class AssertionError
extends DenoAssertionError

Thrown when an assertion fails. Extends Deno's built-in AssertionError so it integrates cleanly with Deno's test runner output.

You rarely construct this directly — assertion methods on Assert throw it automatically on failure.

Examples

Example 1

import { AssertionError } from "qunitx";

try {
  throw new AssertionError({ message: "something went wrong" });
} catch (e) {
  console.log(e instanceof AssertionError); // true
}

Constructors

AssertionError(object: AssertionErrorOptions)

Usage

import { AssertionError } from ".";