Function assertArrayIncludes

  • Make an assertion that actual includes the expected values. If not then an error will be thrown.

    Type parameter can be specified to ensure values under comparison have the same type.

    Type Parameters

    • T

    Parameters

    Returns void

    Since

    24.7.0

    Example

    import { assertArrayIncludes } from "assert";

    assertArrayIncludes([1, 2], [2]); // Doesn't throw
    assertArrayIncludes([1, 2], [3]); // Throws