[][src]Macro insta::assert_serialized_snapshot_matches

macro_rules! assert_serialized_snapshot_matches {
    ($name:expr, $value:expr) => { ... };
    ($name:expr, $value:expr, {$($k:expr => $v:expr),*}) => { ... };
}

Assets a Serialize snapshot.

The value needs to implement the serde::Serialize trait.

Unlike the assert_debug_snapshot_matches macro, this one has a secondary mode where redactions can be defined. The macro takes a third argument which is an object with redaction rules (use jq inspired selector syntax):

This example is not tested
assert_serialized_snapshot_matches!("name", value, {
    ".key.to.redact" => "[replacement value]",
    ".another.key.*.to.redact" => 42
});