• Make an assertion that actual object is a subset of expected object, deeply. If not, then throw.

    Parameters

    • actual: Record<PropertyKey, any>
    • expected: Record<PropertyKey, unknown>
    • Optional msg: string

    Returns void

    Since

    24.7.0

    Example

    import { assertObjectMatch } from "assert";

    assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
    assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws