@rbxts/expect > Assertion > startsWith
Assertion.startsWith() method
Asserts that the array starts with the specified elements.
Signature:
startsWith(elements: InferArrayElement<T>[]): this;
Parameters
Parameter | Type | Description |
---|---|---|
elements | InferArrayElement<T>[] | Elements that the actual array should have at the start. |
Returns:
this
This instance for chaining.
Remarks
Type alias for .
Example
expect([1,2,3]).to.be.an.array().that.startsWith([1,2]);