Skip to main content

@rbxts/expect > ExpectMessageBuilder > build

ExpectMessageBuilder.build() method

Creates an error message to display, based on the data attached to this instance.

Signature:

build(pass?: boolean, negated?: boolean): string;

Parameters

Parameter

Type

Description

pass

boolean

(Optional) Did the check pass?

negated

boolean

(Optional) Was the check negated?

Returns:

string

A string that can be output, rendered in the defined format and with all data attached.

Remarks

This is the final method called, and is usually done by expect() itself.

This creates a string with all the relevant data attached and ready to be thrown as an error.