[−][src]Macro insta::assert_json_snapshot_matches
Asserts a Serialize
snapshot in JSON format.
This works exactly like assert_serialized_snapshot_matches
but serializes
in JSON format. This is normally not recommended because it makes diffs
less reliable, but it can be useful for certain specialized situations.
Example:
ⓘThis example is not tested
assert_json_snapshot_matches!("snapshot_name", vec[1, 2, 3]);
The third argument to the macro can be an object expression for redaction.
It's in the form { selector => replacement }
. For more information
about redactions see redactions.
Additionally the name is optional. For more information see unnamed snapshots