Objects Verifier Reference
Created by should().objects<T extends {}, P extends {}>(entry: T, other: P) — both objects are required up front. The modifier methods configure the comparison; equal() runs it.
Methods
Method | Role |
|---|---|
| runs the deep comparison (inverted by a preceding |
| custom equality for one property; repeatable |
| compare property |
| exclude properties from the comparison |
| exclusive whitelist of properties; overrides |
Order matters: modifiers first, equal() last. Plus the inherited not and defined().
Comparison semantics
Property counts of the two sides must match (after
maprenames and exclusions).Nested objects are compared recursively; nested object values without a
rulefall back to reference equality;Dateproperties compare by string representation.A failing
rulereportsObjects failed custom rule for '<field>'.
Representative messages
The objects has different number of properties.Objects have different '<path>': <val1> & <val2>.— the path includes nesting (user.address.city).
Guide: Objects.