@rbxts/expect > Assertion > startWith
Assertion.startWith() method
Asserts that the array starts with the specified elements.
Signature:
startWith(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.
Example
expect([1,2,3]).to.startWith([1,2]);