Skip to main content

@rbxts/expect > ExpectMessageBuilder > suffix

ExpectMessageBuilder.suffix() method

Adds a string to show at the end of the message, before the metadata.

Signature:

suffix(str?: string): this;

Parameters

Parameter

Type

Description

str

string

(Optional) The string to add after the message.

Returns:

this

This instance, for chaining.

Remarks

Note that there can only be one, calling this method again will replace the previous value- not append to it

Example

new ExpectMessageBuilder(
`Expected ${place.name} to ${place.not} equal ${place.expected.value}`
)
.suffix(` because ${place.reason}`)
.appendPrefix(", but it was not");

// Would be the same as
new ExpectMessageBuilder(
`Expected ${place.name} to ${place.not} equal ${place.expected.value},
but it was not because ${place.reason}`
);