std/assert/unreachable_test.ts
Asher Gomez c2b5460cef
BREAKING(assert): make unreachable() consistent with @std/assert (#4943)
* BREAKING(assert): make `unreachable()` consistent with `@std/assert`

* fix

* fix
2024-06-03 13:33:17 +00:00

12 lines
371 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { AssertionError, assertThrows, unreachable } from "./mod.ts";
Deno.test("unreachable()", () => {
assertThrows(() => unreachable(), AssertionError, "Unreachable.");
assertThrows(
() => unreachable("custom message"),
AssertionError,
"Unreachable: custom message",
);
});