Skip to main content
Module

x/unitest/mod.ts>toMatchObject

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

Use .toMatchObject to check that a object matches a subset of the properties of an object

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

test("passes when object is part of subset", () => {
  expect({ foo: "bar", hello: "world" }).toMatchObject({ foo: "bar" });
});

Parameters

actual: object
expected: Record<PropertyKey, unknown>