@rbxts/expect > ExpectedPlaceholder > fullValue
ExpectedPlaceholder.fullValue property
The "expected" value in an expect() statement, which is not collapsed.
Signature:
fullValue: string;
Remarks
This is the "full" value of the expected variable.
It being full means that it does NOT respect the defined collapseLength.
If you do want it to respect the collapse length, then use value instead.
By default, most messages already have the attachFullOnCollapse setting enabled, so you don't usually have to attach this yourself.
Example
For example, lets say we were checking if an object matched another object:
new ExpectMessageBuilder(
`Expected ${place.actual.value} to be equal to
${place.expected.value}
`
).metadata({
["Expected (full)"]: place.expected.fullValue,
["Actual (full)"]: place.actual.fullValue
});
And the object was larger than our configured collapseLength
, and ended up collapsed:
Expected '{...}' to be equal to '{...}'
Expected (full): '{"name":"Bryan","age":20}'
Actual (full): '{"name":"Daymon","age":24}'
This allows us to keep the main message short and easy to read, while still retaining the full value for debugging.