Skip to main content

@rbxts/expect > Assertion > size

Assertion.size() method

Asserts that the value has a length of size.

Signature:

size(size: number): this;

Parameters

Parameter

Type

Description

size

number

Returns:

this

Remarks

Type alias for length.

Example

expect([1,2,3]).to.have.the.size(3);
expect({ name: "Daymon", age: 5 }).to.have.the.size(2);
expect("Daymon").to.have.the.size(6);