Function assert_eq_or_bless

Source
pub fn assert_eq_or_bless(
    actual: impl AsRef<str>,
    snapshot_path: impl AsRef<Path>,
)
Expand description

Asserts that actual matches the text-file snapshot at snapshot_path. If there is a diff the function will panic with a helpful diff that shows what changed.

If the env var ASSERT_OR_BLESS is set to bless then actual will be written to the snapshot file at snapshot_path instead of asserting that it matches.