Skip to main content

@rbxts/expect > Assertion > array

Assertion.array() method

Asserts that the value is an array of type typeName.

Signature:

array<I extends keyof CheckableTypes>(typeName: I): Assertion<I[]>;

Parameters

Parameter

Type

Description

typeName

I

Returns:

Assertion<I[]>

Remarks

Each element in the array has its type checked via typeOf.

Example

expect([1,2,3]).to.be.an.array("number");
expect([new Vector3()]).to.be.an.array("Vector3");