interface InverseAsymmetricMatchers {
    arrayContaining<E = any>(arr: readonly E[]): any;
    objectContaining<E = {}>(obj: E): any;
    stringContaining(str: string): any;
    stringMatching(str: string | RegExp): any;
}

Methods

  • expect.not.arrayContaining(array) matches a received array which does not contain all of the elements in the expected array. That is, the expected array is not a subset of the received array. It is the inverse of expect.arrayContaining.

    Optionally, you can provide a type for the elements via a generic.

    Type Parameters

    • E = any

    Parameters

    • arr: readonly E[]

    Returns any

  • expect.not.objectContaining(object) matches any received object that does not recursively match the expected properties. That is, the expected object is not a subset of the received object. Therefore, it matches a received object which contains properties that are not in the expected object. It is the inverse of expect.objectContaining.

    Optionally, you can provide a type for the object via a generic. This ensures that the object contains the desired structure.

    Type Parameters

    • E = {}

    Parameters

    • obj: E

    Returns any

  • expect.not.stringContaining(string) matches the received string that does not contain the exact expected string. It is the inverse of expect.stringContaining.

    Parameters

    • str: string

    Returns any

  • expect.not.stringMatching(string | regexp) matches the received string that does not match the expected regexp. It is the inverse of expect.stringMatching.

    Parameters

    • str: string | RegExp

    Returns any