This release is 28 versions behind 1.0.16 — the latest version of @std/assert. Jump to latest
Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Common assertion functions, especially useful for testing
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
2 years ago (0.219.0)
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. /** * Error thrown when an assertion fails. * * @example * ```ts * import { AssertionError } from "@std/assert/assertion_error"; * * throw new AssertionError("Assertion failed"); * ``` */ export class AssertionError extends Error { /** Constructs a new instance. */ constructor(message: string) { super(message); this.name = "AssertionError"; } }