@wpazderski/playwright-utils
    Preparing search index...
    • Ensures that property at provided keyPath exists on the object and optionally checks that property is equal to the expected. Equality is checked recursively, similarly to expect(value).toEqual(expected).

      Usage

      const value = {
      a: {
      b: [42],
      },
      c: true,
      };
      expect(value).toHaveProperty('a.b');
      expect(value).toHaveProperty('a.b', [42]);
      expect(value).toHaveProperty('a.b[0]', 42);
      expect(value).toHaveProperty('c');
      expect(value).toHaveProperty('c', true);

      Parameters

      • internalOptions: MatcherInternalOptions

        Internal options that provide extra context for the matcher.

      • received: object

        Received value.

      • expectedPath: string | string[]

        Path to the property. Use dot notation a.b to check nested properties and indexed a[2] notation to check nested array items.

      • OptionalexpectedValue: unknown

        Optional expected value to compare the property to.

      Returns void