assertArrayIdentical
Assert that an array holds the same members as the expected array, compared by identity, with type narrowing.
The two arrays are compared by length and then member by member using Object.is, so a member that is itself an array or an object has to be the same reference on both sides.
assertIdentical() compares a whole value with ===, and assertArrayEquals() compares members by value.
import { assertArrayIdentical } from "@kensio/smartass";
const admin = { name: "Ada" };const value: unknown = [admin];
assertArrayIdentical(value, [admin]);
// value is now narrowed to [{ name: string }]Source
Section titled “Source”Source file: src/assert/array-identical/array-identical.assert.ts
