Skip to main content

@rbxts/expect > ExpectedPlaceholder

ExpectedPlaceholder interface

The "expected" variable in an expect() statement.

Signature:

interface ExpectedPlaceholder 

Remarks

This is usually the value passed into an assertion method, but not all methods end up having an expected value.

For example, the empty method doesn't have anything it's comparing the actual value to, so it doesn't have an "expected" value.

We refer to it as the "expected" variable, as it's usually what you're expecting the actual variable to be.

Note that you shouldn't use expected directly in your messages, instead you should use one of the properties of this type.

Example

Given the following assertion chain:

expect(5).to.equal(6);

The value 5 is the "actual" value/variable.

It's whatever you pass to expect when calling it initially.

Properties

Property

Modifiers

Type

Description

fullValue

string

The "expected" value in an expect() statement, which is not collapsed.

type

string

A string representing the type of the expected value in an expect() statement.

value

string

The "expected" value in an expect() statement, which can optionally be collapsed.