Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/unitest/expect/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/expect/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>>