Skip to main content

@rbxts/expect > Assertion > endWith

Assertion.endWith() method

Asserts that the array ends with the specified elements.

Signature:

endWith(elements: InferArrayElement<T>[]): this;

Parameters

Parameter

Type

Description

elements

InferArrayElement<T>[]

Elements that the actual array should have at the ends.

Returns:

this

This instance for chaining.

Example

expect([1,2,3]).to.endWith([2,3]);