Macro masonry::assert_render_snapshot
source · macro_rules! assert_render_snapshot { ($test_harness:expr, $name:expr) => { ... }; }
Expand description
Assert a snapshot of a rendered frame of your app.
This macro takes a test harness and a name, renders the current state of the app,
and stores the render as a PNG next to the text, in a ./screenshots/
folder.
If a screenshot already exists, the rendered value is compared against this screenshot. The assert passes if both are equal; otherwise, a diff file is created.
If a screenshot doesn’t exist, the assert will fail; the new screenshot is stored as
./screenshots/<test_name>.new.png
, and must be renamed before the assert will pass.