Skip to main content
Module

x/unitest/mod.ts>toIncludeAllMembers

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

Use .toIncludeAllMembers when checking if an array contains all of the same members of a given set

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

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

test("passes when given array values match the members of the set", () => {
  expect([1, 2, 3]).toIncludeAllMembers([2, 1, 3]);
  expect([1, 2, 2]).toIncludeAllMembers([2, 1]);
});

Parameters

actual: readonly unknown[]
expected: readonly unknown[]