Skip to main content

@rbxts/expect > ExpectMessageBuilder > expected

ExpectMessageBuilder.expected() method

Overwrites all the values for the expected variable.

Signature:

expected(data: VariableData): this;

Parameters

Parameter

Type

Description

data

VariableData

A VariableData containing the and value of the expected variable.

Returns:

this

This instance, for chaining.

Remarks

Instead of calling expectedValue and expectedType separately, you can call this method to set them both at once.

Example

const customEqual: CustomMethodImpl<defined> = (
_,
actual: defined,
expected: defined
) => {
const message = baseMessage.use().expected({
value: expected,
type: typeOf(expected)
});

// ...
};