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