mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
c2b5460cef
* BREAKING(assert): make `unreachable()` consistent with `@std/assert` * fix * fix
12 lines
371 B
TypeScript
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",
|
|
);
|
|
});
|