Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/unitest/matcher/to_be_boolean.ts>toBeBoolean

🃏 Deno-first universal unit testing framework
Latest
function toBeBoolean
import { toBeBoolean } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/to_be_boolean.ts";

Use .toBeBoolean when checking if a value is a boolean

import {
  defineExpect,
  not,
  test,
  toBeBoolean,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

const expect = defineExpect({
  matcherMap: {
    toBeBoolean,
  },
  modifierMap: {
    not,
  },
});

test("passes when value is a boolean", () => {
  expect(false).toBeBoolean();
  expect(true).toBeBoolean();
  expect(1 === 1).toBeBoolean();
  expect(1).not.toBeBoolean();
});

Parameters

actual: unknown