import { toContainValues } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/to_contain_values.ts";
Use .toContainValues
when checking if an object contains all of the provided
values
import {
defineExpect,
not,
test,
toContainValues,
} from "https://deno.land/x/unitest@$VERSION/mod.ts";
const expect = defineExpect({
matcherMap: {
toContainValues,
},
modifierMap: {
not,
},
});
test("passes when object contains all of the given values", () => {
const object = { a: "foo", b: "bar", c: "baz" };
expect(object).toContainValues(["foo"]);
expect(object).toContainValues(["baz", "bar"]);
expect(object).not.toContainValues(["qux", "foo"]);
});