Skip to main content
Module

x/unitest/mod.ts>extendExpect

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

Return new expect based on another expect. All definitions are deep merged. Duplicate fields will be replaced by the new definition.

import {
  expect,
  extendExpect,
  test,
  toBeString,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";

const newExpect = extendExpect(expect, {
  matcherMap: {
    toBeString,
  },
});

test("should be string", () => {
  newExpect("unitest").toBeString();
});

Type Parameters

Matcher extends MatcherMap
Modifier extends ModifierMap
NewMatcher extends MatcherMap
NewModifier extends ModifierMap

Parameters

expect: Expect<Matcher, Modifier>
unnamed 1: Partial<Definition<NewMatcher, NewModifier>>