import { toIncludeAllMembers } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/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]);
});