Skip to main content

@rbxts/expect > Assertion > containExactlyInOrder

Assertion.containExactlyInOrder() method

Asserts that the array contains all of the values in expectedValues, with nothing more or less, and in the same order.

Signature:

containExactlyInOrder(expectedValues: InferArrayElement<T>[]): this;

Parameters

Parameter

Type

Description

expectedValues

InferArrayElement<T>[]

An array of elements that the actual array should be.

Returns:

this

Remarks

There shouldn't be any extra elements in the actual array; both arrays should deeply contain the same elements, and in the same order.

Example

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