This release is 21 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
Works with
•JSR Score100%•This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




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); });