Skip to main content

@rbxts/expect > Assertion > within

Assertion.within() method

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

Signature:

within(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

Type alias for between.

Example

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