2024-01-01 21:11:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-07-13 07:04:30 +00:00
|
|
|
import { assertFalse, assertThrows } from "./mod.ts";
|
|
|
|
|
2023-12-08 16:04:29 +00:00
|
|
|
Deno.test("assertFalse() matches with falsy values", () => {
|
2023-07-13 07:04:30 +00:00
|
|
|
assertFalse(false);
|
|
|
|
assertFalse(0);
|
|
|
|
assertFalse("");
|
|
|
|
assertFalse(null);
|
|
|
|
assertFalse(undefined);
|
|
|
|
});
|
|
|
|
|
2023-12-08 16:04:29 +00:00
|
|
|
Deno.test("assertFalse() throws with truthy values", () => {
|
2023-07-13 07:04:30 +00:00
|
|
|
assertThrows(() => assertFalse(true));
|
|
|
|
assertThrows(() => assertFalse(1));
|
|
|
|
assertThrows(() => assertFalse("a"));
|
|
|
|
assertThrows(() => assertFalse({}));
|
|
|
|
assertThrows(() => assertFalse([]));
|
|
|
|
});
|