Skip to main content

@rbxts/expect > Assertion > satisfy

Assertion.satisfy() method

Asserts that the value returns true for the given filter.

Signature:

satisfy(filter: Filter<T>): this;

Parameters

Parameter

Type

Description

filter

Filter<T>

Callback that returns true if the value passes.

Returns:

this

This instance for chaining.

Remarks

If the passed filter is a named function, the function's name will be used in the failure messages.

Example

expect(5).to.satisfy((it) => it >= 0);