@rbxts/expect > Assertion > array
Assertion.array() method
Asserts that the value is an array of type I
, according to a custom callback TypeCheckCallback.
Signature:
array<I>(checker: TypeCheckCallback<I>): Assertion<I[]>;
Parameters
Parameter | Type | Description |
---|---|---|
checker |
Returns:
Assertion<I[]>
Example
const isNumber: TypeCheckCallback = (value) => {
return typeOf(value) === "number";
}
expect([1,2,3]).to.be.an.array(isNumber);