@wpazderski/playwright-utils
    Preparing search index...
    objectContaining: typeof objectContaining

    expect.objectContaining() matches an object that contains and matches all of the properties in the expected object. Note that received object may be a superset of the expected object and contain some extra properties.

    Use this method inside expect(value).toEqual(expected) to perform pattern matching. Object properties can be matchers to further relax the expectation. See examples.

    Usage

    // Assert some of the properties.
    expect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ foo: 1 }));

    // Matchers can be used on the properties as well.
    expect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ bar: expect.any(Number) }));

    // Complex matching of sub-properties.
    expect({
    list: [1, 2, 3],
    obj: { prop: 'Hello world!', another: 'some other value' },
    extra: 'extra',
    }).toEqual(expect.objectContaining({
    list: expect.arrayContaining([2, 3]),
    obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),
    }));

    Expected object pattern that contains a subset of the properties.