std@0.139.0/_util/assert_test.ts

Deno standard library
GitHub Stars
2218
Go to latest
assert_test.ts
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.import { assert, DenoStdInternalError } from "./assert.ts";import { assertThrows } from "../testing/asserts.ts";
Deno.test({ name: "assert valid scenario", fn(): void { assert(true); },});
Deno.test({ name: "assert invalid scenario, no message", fn(): void { assertThrows(() => { assert(false); }, DenoStdInternalError); },});Deno.test({ name: "assert invalid scenario, with message", fn(): void { assertThrows( () => { assert(false, "Oops! Should be true"); }, DenoStdInternalError, "Oops! Should be true", ); },});