Skip to main content
Module

x/unitest/mod.ts>toBeFunction

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

Use .toBeFunction when checking if a value is a Function

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

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

test("passes when value is a function", () => {
  expect(() => {}).toBeFunction();
  expect(function () {}).toBeFunction();
  expect(true).not.toBeFunction();
});

Parameters

actual: unknown