Skip to main content
Home
This release is 21 versions behind 1.0.16 — the latest version of @std/assert. Jump to latest

@std/assert@0.224.0
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads60,953/wk
Published2 years ago (0.224.0)

Common assertion functions, especially useful for testing

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assert, AssertionError, unimplemented } from "./mod.ts"; Deno.test("AssertsUnimplemented", function () { let didThrow = false; try { unimplemented(); } catch (e) { assert(e instanceof AssertionError); assert(e.message === "Unimplemented."); didThrow = true; } assert(didThrow); });