Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/hex/src/di/tests/deps.ts>asserts.assertArrayIncludes

An ecosystem delivering practices, philosophy and portability.
Go to Latest
function asserts.assertArrayIncludes
import { asserts } from "https://deno.land/x/hex@0.5.15/src/di/tests/deps.ts";
const { assertArrayIncludes } = asserts;

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. For example:

import { assertArrayIncludes } from "https://deno.land/std@0.224.0/testing/asserts.ts";

assertArrayIncludes<number>([1, 2], [2])

Parameters

actual: ArrayLike<T>
expected: ArrayLike<T>
optional
msg: string