Skip to main content

@rbxts/expect > Assertion > arrayOf

Assertion.arrayOf() method​

Asserts that the value is an array of type typeName.

Signature:

arrayOf<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.

Type alias for the array version of this

Example​

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