Skip to main content

@rbxts/expect > ExpectMessageBuilder > (constructor)

ExpectMessageBuilder.(constructor)

Create a new instance of ExpectMessageBuilder.

Signature:

constructor(prefix?: string, negationPrefix?: string, options?: Partial<ExpectMessageBuilderOptions>);

Parameters

Parameter

Type

Description

prefix

string

(Optional) Contents of the message, generally the static portion (defaults to Placeholder.reason).

negationPrefix

string

(Optional) A prefix to use when the message is negated (replaces the standard prefix). If you don't provide a negation prefix, the prefix will be used instead (in the case of negations).

options

Partial<ExpectMessageBuilderOptions>

(Optional) Configuration settings for message output.

Remarks

Intended to be used in custom methods for expect().

If you don't provide a prefix, you can instead use a reason to create your message at runtime.