• compares the passed in expected object to an actual checking that they both contain all the same properties and property types as are found in the expected object. for example, given an expected of:

    const expected = {
    foo: 'bar',
    baz: true
    }

    and an actual of:

    const actual = {
    foo: 'foo',
    bar: 42,
    baz: false
    }

    calling the following:

    matchingProps(expected).setActual(actual).compare(); // true
    

    would return true because actual has both a foo property of type string and a baz property of type boolean. usage in an AftTest.verify function would look like:

    const t = new AftTest('description', () => null);
    await t.verify(() => {foo: 'bar', baz: true}, matchingProps({foo: 'any', baz: false})); // succeeds

    Parameters

    • expected: Record<string | number | symbol, any>

      an object or array containing properties

    • maxDepth: number = Infinity

      a number indicating how deeply comparison should recurse into the objects

    Returns MatchingProperties

    a new {HavingProperties} instance

    Default

    Infinity
    

Generated using TypeDoc