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