Skip to main content
Module

x/unitest/mod.ts>defineExpect

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

Creates a fully customized expect. By default, there are no matchers or modifiers. You can choose and configure only the matchers you want. This allows you to optimise the bundle size.

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

const expect = defineExpect({
  matcherMap: {
    toBe,
    ...jestExtendedMatcherMap,
  },
  modifierMap: {
    not,
  },
});

test("unitest is similar jest but not the same", () => {
  expect("unitest").not.toBe("jest");
});

Type Parameters

MatcherObject extends MatcherMap
Modifier extends ModifierMap

Parameters

unnamed 0: Definition<MatcherObject, Modifier>