Skip to main content

@rbxts/expect > Assertion > between

Assertion.between() method

Asserts that the actual value is a number within a specified range.

Signature:

between(minValue: number, maxValue: number): Assertion<number>;

Parameters

Parameter

Type

Description

minValue

number

The lower end of what this value can be.

maxValue

number

The higher end of what this value can be.

Returns:

Assertion<number>

Remarks

The check is performed inclusively, so an actual value of 2 and a minValue of 2 is considered a pass.

Example

expect(10).to.be.between(5, 15);
expect(5).to.be.between(5, 6);