diff --git a/std/testing/asserts.ts b/std/testing/asserts.ts index 50c45c6ca2..ea15aa6bc1 100644 --- a/std/testing/asserts.ts +++ b/std/testing/asserts.ts @@ -269,8 +269,8 @@ export function assertStringContains( * If not then thrown. */ export function assertArrayContains( - actual: unknown[], - expected: unknown[], + actual: ArrayLike, + expected: ArrayLike, msg?: string ): void { const missing: unknown[] = []; diff --git a/std/testing/asserts_test.ts b/std/testing/asserts_test.ts index 8b79ddf8ab..35ce500316 100644 --- a/std/testing/asserts_test.ts +++ b/std/testing/asserts_test.ts @@ -159,6 +159,10 @@ Deno.test("testingArrayContains", function (): void { const fixtureObject = [{ deno: "luv" }, { deno: "Js" }]; assertArrayContains(fixture, ["deno"]); assertArrayContains(fixtureObject, [{ deno: "luv" }]); + assertArrayContains( + Uint8Array.from([1, 2, 3, 4]), + Uint8Array.from([1, 2, 3]) + ); assertThrows( (): void => assertArrayContains(fixtureObject, [{ deno: "node" }]), AssertionError,