Make an assertion that actual includes the expected values. If not then an error will be thrown.
actual
expected
Type parameter can be specified to ensure values under comparison have the same type.
Optional
24.7.0
import { assertArrayIncludes } from "assert";assertArrayIncludes([1, 2], [2]); // Doesn't throwassertArrayIncludes([1, 2], [3]); // Throws Copy
import { assertArrayIncludes } from "assert";assertArrayIncludes([1, 2], [2]); // Doesn't throwassertArrayIncludes([1, 2], [3]); // Throws
Make an assertion that
actualincludes theexpectedvalues. If not then an error will be thrown.Type parameter can be specified to ensure values under comparison have the same type.