Expand description
Unified-diff rendering for assertion failures.
Produces a plain-text diff (no ANSI) so it survives the
Rust โ QuickJS โ JS error round trip. Printers add color at output
time. The format matches the GNU diff -u shape โ - for expected
lines (what we asked for), + for received (what the test got),
for context.
Functionsยง
- json_
diff - Render
expectedvsreceivedas pretty JSON + a unified diff. Suitable fortoEqual/toMatchObject/toContainEqualwhere the full structural shape matters. - pretty_
json - Render a
serde_json::Valueas multi-line pretty JSON with asymmetric matchers rendered as<Description>placeholders so the diff highlights the matcher rather than its tagged wire shape. - unified_
diff - Unified diff between two pretty-printed strings. Lines are prefixed
with
-/+/; empty when the two inputs are byte-identical.